[jquery] How to get the full path of the file from a file input

Possible Duplicate:
Full path from file input using jQuery

I have the following html element

<input type="file" id="upload">

If I use

$("#upload").val();

I only the file name, not the complete absolute path of the file. Can someone tell me how do get the complete path?

This question is related to jquery html

The answer is


You cannot do so - the browser will not allow this because of security concerns. Although there are workarounds, the fact is that you shouldn't count on this working. The following Stack Overflow questions are relevant here:

In addition to these, the new HTML5 specification states that browsers will need to feed a Windows compatible fakepath into the input type="file" field, ostensibly for backward compatibility reasons.

So trying to obtain the path is worse then useless in newer browsers - you'll actually get a fake one instead.