need help on this, trying to upload images from IE9 I get an C:fakepath/name_of_my_file
how do I remove this C:fakepath?
Thanks
if($('#ficheiro').val().search(/C:fakepath/)) {
$('#ficheiro').val().val($('#ficheiro').val().replace('C:fakepath',''));
nome.val('pics/'+$('#ficheiro').val());
} else {
nome.val('pics/'+$('#ficheiro').val());
}
You can use this and it will also remove the slashes leaving you just the filename.
$(this).val().replace(/C:\\fakepath\\/i, '');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With