Reputation: 1490
I am using a bit of a workaround to the <input type="file">
You can see what I am doing here:
http://jsfiddle.net/susannalarsen/zU57Q/
The only problem I am having is that I cannot get rid of the C:\fakepath text that is appearing before any file I select.
How can I stop this from showing
Upvotes: 0
Views: 50
Reputation: 2636
Not sure if the best possible answer but simply typing
.substring(12)
would remove the fakepath
$('#uploadme').change(function(){
$('#filename').val($(this).val().substring(12));
});
Upvotes: 2
Reputation: 78520
You mean like this?
$('#filename').val($(this).val().replace(/.*\\/, ''));
Upvotes: 1