I have an upload field and I want to read user input with jquery
My html is this
<input type="hidden" id="MAX_FILE_SIZE" value="1999500" name="MAX_FILE_SIZE">
<input type="file" id="upl-0" name="upl[]">
<input type="file" id="upl-1" name="upl[]">
<input type="file" id="upl-2" name="upl[]">
In my jQuery, I do this
var paths = '';
$('input[type=file]').each(function(){
paths = paths + $(this).val();
});
alert(paths);
but I'm getting only the file name, not the full path. When I select C:/folder/file.doc
, I get only file.doc
. I'm trying to get this path to populate the field again on a failed form attempt without the user having to reselect the files, so I need the full path for this to work. How can I get it?