Can anyone help me out here? I'm trying to determine why I can't get this code to work. The only reason I use the <input type=file> tag is so that a user has access to the browse button. Once the file file is selected, I'll be grabbing the complete path to the file in order to process it.
In my .aspx I have the following two lines in a form (all fields are set to runat=server):
<input type="file" id="imagefile" size="30" runat="server"/>
<input type="file" id="thumbfile" size="30" runat="server"/>
In my .cs file (codebehind) I have the following lines to capture the values:
(in class definition)
protected HtmlInputFile imagefile;
protected HtmlInputFile thumbfile;
(in Page_Load event)
private void Page_Load(object sender, System.EventArgs e)
Response.Write(imagefile.PostedFile.FileName + "<br/>" + thumbfile.PostedFile.FileName);
If I leave the fields blank, the page posts back to itself fine. However, if I select a file for both pages, it doesn't seem to work. For some reason it takes me back to 404 error page (page cannot be displayed). The URL in my address bar never changes. Any insights?