Why does image upload fail php#39;s is_uploaded_file check?(为什么图片上传失败 php 的 is_uploaded_file 检查?)
问题描述
我有一个允许上传图片的 html 表单,但现在上传的图片由于某种原因未能通过is_uploaded_file"检查.
I have a html form that allows image uploads, but the image uploaded now fails the "is_uploaded_file" check for some reason.
那么为什么上传失败了 is_uploaded_file 检查?
HTML:
PHP:
我对 $file 或 $_FILES 数组进行了转储:
I did a dump on the $file or $_FILES array:
文件大小不是太大,错误为0,为什么is_uploaded_file检查失败?
File size is not too large, and the error was 0. So why does it fail the is_uploaded_file check?
推荐答案
可能是windows的问题,因为它区分大小写,如果路径不同则不匹配.尝试使用 realpath($file['tmp_name'])
Might be a problem with windows, since it's case sensitive and will not match if the path is different. Try using realpath($file['tmp_name'])
这篇关于为什么图片上传失败 php 的 is_uploaded_file 检查?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!