while using blank file , fileUpload doesn't work.
-
Hi, if (FileUpload1.HasFile == true) { FileUpload1.SaveAs(Server.MapPath("~/AdminSection/Attachment/Emp/" + FileUpload1.FileName.ToString())); } If file is not blank, then this code work fine. but if the file is blank then it doesn't. Is there any Solution for this. or tell me how to check whether file (File can be of any type) is blank or not. Thanx. :)
-
Hi, if (FileUpload1.HasFile == true) { FileUpload1.SaveAs(Server.MapPath("~/AdminSection/Attachment/Emp/" + FileUpload1.FileName.ToString())); } If file is not blank, then this code work fine. but if the file is blank then it doesn't. Is there any Solution for this. or tell me how to check whether file (File can be of any type) is blank or not. Thanx. :)
Priyagdpl wrote:
or tell me how to check whether file (File can be of any type) is blank or not.
Check FileUpload1.FileBytes.Length or FileUpload1.FileContent.Length for validating the file size. :-D
Arun Jacob http://codepronet.blogspot.com/
-
Priyagdpl wrote:
or tell me how to check whether file (File can be of any type) is blank or not.
Check FileUpload1.FileBytes.Length or FileUpload1.FileContent.Length for validating the file size. :-D
Arun Jacob http://codepronet.blogspot.com/