Reputation:
I am trying to extract the entire path of the file that a user uploads on the browser and this i need to do using javascript or jquery.
If i give ($("#userfile").val());
i am able to extract only the file name and not the entire path.
Could someone please help me with this?
Upvotes: 3
Views: 2014
Reputation: 11
With IE8 this is not the case too. IE8 hides the real path to the file and changes it, for example, to:
C:\\**fakepath**\filename
Upvotes: 1
Reputation: 25
as indicated above this is usually permission issue. try and and move the file to a different area and grant it full permissions.
var path = $('#file').attr("value");
this will also give you the path of the file
Upvotes: 1
Reputation: 39986
Internet explorer will give you the full path, but other browsers won't. here's an example page i found that demonstrates this
Upvotes: 2
Reputation: 546503
I believe that it's a security measure to not reveal the entire path of file inputs.
Upvotes: 2