在PHP中获取表单中文件上传字段的完整路径 [英] Getting the Full Path Of A File Upload Field In A Form in PHP

查看:111
本文介绍了在PHP中获取表单中文件上传字段的完整路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PHP上传文件。我想获得文件选择的完整路径。有没有什么办法可以在PHP中获得完整路径?



例如:我上传了一个图像:c:\upload\check.jpeg

我想要完整路径..作为c:\upload\check.jpeg。

我试过了pathinfo,$ _FILES。但没有帮助。

预先感谢您。

解决方案

现在许多浏览器都不会发送这些信息,因为它可以为攻击者提供关于用户系统的信息。


I am using a file upload in PHP. I want to get the Full PATH of the File Selected. Is there any way i can get the full path in PHP??

For Eg: i uploaded a image from : "c:\upload\check.jpeg"
I want the full path.. as "c:\upload\check.jpeg".

i tried pathinfo, $_FILES. But no help.

Thanks in advance.

解决方案

You probably can't. Many browsers these days don't send that information, as it can give attackers information about the user's system.

这篇关于在PHP中获取表单中文件上传字段的完整路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆