dongxuxian1123 2017-03-10 17:13
浏览 53
已采纳

如何在php中读取文件路径

I am looking for file path store in local system for eg. when I select file and post to another page then I Just want it's real path.

<form action="post.php" method="post" enctype="multipart/form-data">

    Select File: <input type="file"  name="file"> 

   <input type="submit" name="submit" value="Upload File!" /> 

 </form>

I know how to upload file but I don't wan't to upload file Just want to read path of that selected file for Eg.

C:/Users/Public/Pictures/Sample%20Pictures/Koala.jpg

Actually I am working on Exeoutput for PHP 2 it's running on local server so when user upload file it's not support file upload so am trying to store file path for image upload , so when ever program will start so selected image will autoamtically will show

   <img href='C:/Users/Public/Pictures/Sample%20Pictures/Koala.jpg'/‌​>

Thanks In Advance

  • 写回答

1条回答 默认 最新

  • douhan1992 2017-03-10 17:48
    关注

    You can't.

    File inputs are designed to upload files.

    For security reasons, they conceal information about where exactly the file came from. In the context of the WWW, it should not matter to the server where the user kept the file on their computer.

    Even though you are using an HTTP server and web browser in a non-WWW content, you can't override these security features.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决