views:

134

answers:

1

I have a User Control that contains a System.Web.UI.WebControls.FileUpload control as well as a button to 'Submit'.

When the button is clicked code similar to the following is executed:

If FileUploadControl.HasFile Then
   'Save the file and do some other stuff
End If

This code works just fine with Windows XP. However, if I run it from a Windows 7 64-bit machine using IE8 32-bit the HasFile property always returns false and nothing is saved?!

Any suggestions/ideas would be greatly appreciated.

+1  A: 

I've had such problems with FileUpload control as well (not specifically with Windows 7). Try checking !string.IsNullOrEmpty(fileUploadControl.FileName) instead. I don't know if it will help in your particular case, but I it worked for me.

Evgeny