最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - how to get client side path of the uploded file - Stack Overflow

programmeradmin5浏览0评论

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
Add a ment  | 

2 Answers 2

Reset to default 7

You 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
发布评论

评论列表(0)

  1. 暂无评论