doushi5024 2011-08-08 17:51
浏览 234
已采纳

上传后获取服务器上文件的客户端路径

enter image description here

I want to know the REALPATH of selected file. Like I uploaded the image. I want to know F:\ubuntu\Ubuntu.ico.

This is my code:

<pre>
<?php
print_r($_FILES);
?>
</pre>

<form method="post" action="" enctype="multipart/form-data">
    <input type="file" name="fupload" id="fupload" />
    <input type="submit" value="Upload" />
</form>

Output:

Array
(
    [fupload] => Array
        (
            [name] => Ubuntu.ico
            [type] => image/x-icon
            [tmp_name] => D:\xampp\tmp\php89.tmp
            [error] => 0
            [size] => 1150
        )

)
  • 写回答

2条回答 默认 最新

  • dongyaobo9081 2011-08-08 17:58
    关注

    You can't know the full path on the client system. Most browsers simply do not expose that information to webpages. Giving that information can expose information about the client system (e.g. usernames, installed software packages) and the usecases for the server knowing the path are very rare.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog