views:

434

answers:

4

Hi All,

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?

+2  A: 

I believe that it's a security measure to not reveal the entire path of file inputs.

nickf
+2  A: 

Internet explorer will give you the full path, but other browsers won't. here's an example page i found that demonstrates this

Scott Evernden
FF2 gives you the full path as well.
Crescent Fresh
A: 

Yeah, browser security measure.

jarrett
A: 

With IE8 this is not the case too. IE8 hides the real path to the file and changes is for example to:

C:\**fakepath**\filename

Martin Dobrev