I am trying to prevent IE from sending the full file path to the server on a file upload. So I am trying to parse out the filename. In my HTML I have:
<input id="fileupload" type="file" name="cutsheet" data-url="ws/cutsheet/representation">
So if the value attribute is "c:\folder\file.txt", I want to change that to "file.txt". I have the following javascript:
$('#fileupload').change(function() {
var index = this.value.lastIndexOf('\\');
this.value = this.value.substring(index + 1);
alert(this.value);
});
However, my alert shows "c:\folder\file.txt". Can I not set the value attribute's value?