Home >Backend Development >PHP Tutorial > php怎么获取表单下传文件的绝对路径

php怎么获取表单下传文件的绝对路径

WBOY
WBOYOriginal
2016-06-13 12:51:07895browse

php如何获取表单上传文件的绝对路径
图片:

$src=$_POST['src'];
获取的是 1.jpg
如何获取包含绝对路径的地址,如:D:\php\Essamp\wwwroot\huaxia\Img\1.jpg


------解决方案--------------------
当file改变(onchange时间记录)时候将src给隐藏域赋值,服务端获取该隐藏域就行了
------解决方案--------------------
1 这样做没有意义 将用户的本地路径展示出来会招致反感 
2 如果非要这么做 可以将输入框中的字符串赋值给页面中hidden变量 这样post出去就可以
  给你个参考 js赋给hidden变量你自己实现吧
  
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn