Hello there,
Good Morning,
I am facing a peculiar problem.
I have the following code in the html section of my .apsx page
<input type="file" runat="server" id="fileBrowse" NAME="fileBrowse">
and the following code in my code behin:
string srcUrl = System.IO.Path.GetFullPath(fileBrowse.PostedFile.F ileName);
string srcFileName =
System.IO.Path.GetFileName(fileBrowse.PostedFile.F ileName);
Stream fStream = fileBrowse.PostedFile.InputStream;
byte[] contents = new byte[fStream.Length];
fStream.Read(contents, 0, (int)fStream.Length);
fStream.Close();
I also have another server side control whcih is a button
<asp:button id="AddUser" runat="server" Text="test">
when I click on this button and then try to upload the file, the
reference to the file which has to be uploaded is lost....
and fileBrowse.PostedFile.FileName holds value = ""....
I am not able to figure out how to go about this....
any idea why this is happening....
Kind Regards,
Srikanth Pai