0

hi, i have set a condition on the upload function

if (FileUploadControl1.PostedFile == null) {

lblResult.Text = "Please select a file first";

}

else

{
//upload a file
}

but if i press upload button when no file is selected it still uploads a blank file regardless of the "if' condition i set, does any1 know why this might be?

cheers

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by julseypart
0

Try this:

if ([B]FileUploadControl1.HasFile[/B])
{
    //upload a file   
}
else
{
    lblResult.Text = "Please select a file first";   
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.