I am trying to utilize an <asp:FileUpload>
control in order to obtain the inputstream of a picture for conversion into a byte array and storage in a database.
When attempting to add the <asp:FileUpload>
control, I noticed it comes with a static button and text field. While I appreciate the text field, I wish to modify the button's text as my site is entirely in English and the button text seems to change based on factors like browser language or operating system settings.
After researching online, I came across suggestions to create a hidden html button using
<input type='button' style='visibility: hidden'>
, and then use JavaScript to trigger the file upload button. However, upon adding runat=server
to the hidden file button, I encountered difficulty locating it through the document.getElementById
JavaScript function, thus impeding access to the inputstream or the file itself.
My query pertains to whether there exists a straightforward method to alter the text of an <asp:FileUpload>
so that I can still make use of this control. Alternatively, could you please provide guidance on how I might successfully interact with the hidden file button using code behind to obtain its inputstream?