I'm modifying an existing ASP.NET project. The original author erroneously tried to create a styled asp:FileUpload by setting its visibility to hidden and just creating two custom styled browse and save buttons.
For security reason, IE does not permit this. My strategy is to instead try to use input tags with type="file", like this example. So if I set up the input like <input type="file" ID="inputFile" />
how do I access/save the file in my code behind, inputFile.SaveAs("someFile.txt");
? Also (in code behind) can I do something like inputFile.HasFile
or is there some other analog of this?
As per recommendations I'm trying something like the following:
<td>
Enabled: <asp:CheckBox ID="CheckBox2" runat="server" />
<div id="testFileUploader">>
<input type="file" id="browserHidden" runat="server" />
<div id="browserVisible"><input type="text" id="fileField" /></div>
</div>
</td>