ASP.NET FileUpload - How do I change the language for the description of the Browse ... button?

I know that a very similar question has already been sent ( How to change the text of the browse button in FileUpload Control (System.Web.UI.WebControls) ), and I understand that it is impossible to change the description to some custom text, but is it possible at least change it to another language (like English)?

I would like to make it so that my webpage is seamless in one language (because, for example, “Procházet ...” instead of “Browse ...” in the middle of the English webpage looks a little strange to me).

+4
source share
3 answers

This is determined at the browser level, if you have not moved to something like flash-based uploader (or <iframe> trickery), you cannot configure it. Whatever language or localization the user browser uses (usually based on the OS settings), this language will be displayed on the "Browse ..." button.

If your page is intended for consumers, probably already in that language, then you are all set, the default behavior works. If people with the settings for another language come, well ... what language they chose, so it should be an intuitive button label, even if it doesn't match.

+3
source

Although there is a direct way to change the Caption of the InputFile control, but you can always go in an alternative way.

  • Add an InputFile control to your page, say, "fileUpload" and make it hidden or invisible.
  • Add a new HTMLButton in the form with text. No matter what you want to give it to the file upload button (in addition, you can also add a TextBox to show the name of the downloaded file when events are processed on the server side).
  • Onclick button even higher used below javascript
 document.getElementById("fileUpload").click(); 

It will do the same without showing the default InputFile .

+3
source

No, this is a client operating system issue.

+1
source

Source: https://habr.com/ru/post/1313176/


All Articles