【发布时间】:2015-10-12 19:39:43
【问题描述】:
我正在尝试在图像上传脚本上使用getimagesize() 函数。
有时,在某些图像上,我得到一个错误。
所以我试图调查。
我使用了一个似乎可以工作的图像,用paint.exe对其进行了编辑,并将其保存为一个新的jpg图像。
当我查看$_FILES[] 时,我明白了:
原文:
$_FILES : array(2) {
["thumb_a_uploader"]=> array(5) {
["name"]=> string(8) "1212.jpg"
["type"]=> string(10) "image/jpeg"
["tmp_name"]=> string(14) "/tmp/phprZ2H8G"
["error"]=> int(0)
["size"]=> int(90281)
}
已编辑:
$_FILES : array(2) {
["thumb_a_uploader"]=> array(5) {
["name"]=> string(16) "1212 - Copy.jpg"
["type"]=> string(0) ""
["tmp_name"]=> string(0) ""
["error"]=> int(2)
["size"]=> int(0)
}
对于已编辑的,图像类型已被擦除。 我用智能手机拍摄的照片也有同样的问题。
有什么想法吗?
【问题讨论】:
-
你得到
error => 2这个错误是UPLOAD_ERR_FORM_SIZE Value: 2; The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.
标签: php image file upload getimagesize