File uploader shows C:/fakepath/

Hey, I keep noticing that whenever I use the standard Mendix File uploader widget and I add a file, the filename bar shows the text C:/fakepath/ etc instead of the actual filepath. Is there a way to change this, not show it or otherwise fix it. Because this just looks weird to users and lands us questions. Regards, Louis
3 answers

Maybe it's possible to do something with styling, I'm not sure. You could find some pointers at Note that this is not a Mendix-specific issue but a browser security feature.


In the modeler, I select to show the label for the uploader. When the user clicks the label, the file explorer popup is shown too. Then, I use CSS to completely hide or overlay the uploader with its label and style the label with a camera icon to make it appear like a camera button. Or anything else you might like. Some part of the uploader cannot be hidden using display:none or it will no longer work.


I used JavaScript Snippet and selected jQuery 3.1.1 and used the refresh stuff.
And in the text field wrote this kind of code: 

setTimeout( function() {


$(".mx-wrapped-label").val(this.files ? this.files[0].name : '...')


}, 200);

In which the “input” is used to select the input field then this function inside the “.change()” is called when there are changes in the input field.
And then by the class name selected the input window and changed the text value to file name if there are file selected and three dots if not.

P.S. Used the set timeout because the couldn’t manage to call JavaScript when page is finished rendering.