我有一张用旧数码相机拍摄的图像,大小约为 4MB,类型为“image/jpeg”。
当我通过表单提交并查看 var_dump($_FILES);
时,数组如下:
array(1) {
["userfile"]=> array(5) {
["name"]=> string(12) "IMGP0004.JPG"
["type"]=> string(0) ""
["tmp_name"]=> string(0) ""
["error"]=> int(1)
["size"]=> int(0)
}
}
我想知道它是否没有选择文件类型并将文件大小检测为 0 是否有原因。其他文件回显所有正确信息。
最佳答案
error
属性设置为1
,这意味着
Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini.
错误代码解释here .
关于php - var_dump($_FILES) result in blank ["type"] 对于特定的图像文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14833065/