I have a form that uploads files, i need to get client side path to file?
server path i could get from php array $_FILES
$_FILES["UploadFileName"]["tmp_name"]
how to get client side path to file stored on a client puter?
<form method="POST" action="upload.php" enctype="multipart/form-data">
<p>File to upload : <input type ="file" name = "UploadFileName"></p><br />
<input type = "submit" name = "Submit" value = "Press THIS to upload">
</form>
I have a form that uploads files, i need to get client side path to file?
server path i could get from php array $_FILES
$_FILES["UploadFileName"]["tmp_name"]
how to get client side path to file stored on a client puter?
<form method="POST" action="upload.php" enctype="multipart/form-data">
<p>File to upload : <input type ="file" name = "UploadFileName"></p><br />
<input type = "submit" name = "Submit" value = "Press THIS to upload">
</form>
Share
Improve this question
asked Feb 16, 2013 at 21:46
user1942505user1942505
5205 gold badges11 silver badges21 bronze badges
2
- 1 Why not scan their whole file tree while you get the file paths it... seems legit! – recursion.ninja Commented Feb 16, 2013 at 21:49
- At best you can get the original filename, but you will not be allowed to get the entire file path. – datasage Commented Feb 16, 2013 at 21:51
2 Answers
Reset to default 7You can't. That's a security matter and the browsers will not provide that to you.
How to get client side path to file stored on a client puter?
It is not allowed for security reasons.If this were possible, an attacker could gain information regarding how files/folders were structured on a client puter. Any fully trusted code on users' machine can do that. So your goal is to convince user to install something that will provide you with the information.
For Windows (all require installation of some sort):
- ActiveX controls
- Native EXE
- Locally installed managed EXE
- locally installed HTA for IE only