Posted on: 10/30/2013 8:57:16 AM | Views : 889

I am trying to upload HTML file. It's uploading ok without error but when I try to view the page it is blank. What can be the reason? 
if (FileUpload2.PostedFile.ContentLength == Convert.ToInt32(0)) //HTML File { cmd.Parameters.Add("@CatHTML", SqlDbType.VarChar, 50).Value = Convert.ToString("-"); } else { string Html1ID = Guid.NewGuid().ToString(); p = CheckFileType(FileUpload2.PostedFile); if (p == true) { Extention = Path.GetExtension(FileUpload2.PostedFile.FileName); string FileName = "HTML1" + "_" + Html1ID + Extention; cmd.Parameters.Add("@CatHtml", SqlDbType.VarChar, 50).Value = FileName; FileUpload1.SaveAs(physicalpath + "Admin\\Uploads\\CategoryHTML\\" + FileName); } }

public static bool CheckFileType(System.Web.HttpPostedFile file) { if ((file.ContentType != "application/octe ...

Go to the complete details ...