Search code examples
asp.netprogramming-languagesglobalizationculturecurrentculture

How set the culture for fileupload (input file) control in ASP.NET


I encounter problem when changing culture (language) on my website. In fact all the controls correctly change language. But only controls "asp: FileUpload" do not change. The text description is always the same ... Is it possible to force the language on the buttons like "" or "?

Thank you already in advance.


Solution

  • You can hide the button thru CSS styling selecting its ID.

    <style type="text/css">
        input.fileUpload{
            display: block;
            visibility: hidden;
            width: 0;
            height: 0;
        }
    </style>
    

    Then create a button that would trigger the file upload.

    <script type="text/javascript">
    $("#alternateUploadButton").click(function(){
        $("#fileUpload").click();
    });
    </script>
    <input type="file" id="fileUpload" name="fileUpload">
    <button id="alternateUploadButton">
        Get a file or whatever name you want
    </button>
    

    http://jsfiddle.net/SPVkq/