简体   繁体   English

<input type=“file” name=“img” accept=“.jpg”>仅检索完整路径插入的图像名称,如何解决?

[英]<input type=“file” name=“img” accept=“.jpg”> is retriving only image name insted of full path, how to fix it?

<input type=file name=img accept=".jpg"> is retrieving only image name instead of full path, how to fix it? <input type=file name=img accept=".jpg">仅检索图像名称而不是完整路径,如何解决?

for example: if image URL is c:\\images\\img.jpg , It taking only img.jpg , instead of full path . 例如:如果图像URL为c:\\images\\img.jpg ,则仅使用img.jpg而不是完整路径 it works fine in older version of browsers like iexplorer.. But not working in Chrome and Firefox. 它在iexplorer等较旧版本的浏览器中可以正常工作。但是在Chrome和Firefox中则无法使用。

尝试这个:

$filePath = realpath($_FILES["file"]["tmp_name"]);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 <input type=“file”>只读取文件名而不是完整路径 - <input type=“file”> reads only file name not full path 如何允许<input type="“file”">只接受.jpeg 和.jpg 文件? - How to allow <input type=“file”> to accept only .jpeg and .jpg files? 如何允许<input type="file">只接受图像文件? - How to allow <input type="file"> to accept only image files? 有没有办法只接受输入按钮具有特定名称的文件? - Is there a way to only accept a file with a certain name for an input button? 如何用文本区域中的相同动作替换输入类型文件插入的图像(图标)? - How to replace image (icon) insted of input type file with same action in text area? 如何限制我的输入类型=“文件”只接受在Firefox中不起作用的png图像文件 - How to restrict my input type=“file” to accept only png image files not working in Firefox 从中提取路径和文件名 <img > 标签 - Extract path and file name from <img > tag 如何使用jQuery或PHP更改img src目录或图像文件名 - How to change img src directory or image file name with jquery or PHP 如何强制输入类型文件仅接受.html或.htm文件 - how to force input type file to accept only .html or .htm files 如何在Safari中允许输入类型=文件仅接受图像文件 - How to allow input type=file to accept only images files in Safari
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM