首页 文章

PHP上传文件错误代码8

提问于
浏览
0

我有一个表格很好(上传)许多图像文件和不同的大小 .

但是有些图像没有上传到服务器 .

问题图片已空 $_FILE[name][tmp_name]$_FILE[name][error] == 8.

同时上传其他图像(文件大小更大或更小) .

你有什么想法吗?

谢谢 .

print_r($_FILES) for normal image

FILES:Array
(
    [img] => Array
        (
            [name] => Array
                (
                    [0] => 1320600215_0_284da_78d5c77a_xl.jpg
                )

            [type] => Array
                (
                    [0] => image/jpeg
                )

            [tmp_name] => Array
                (
                    [0] => /var/www/test/data/mod-tmp/phpoqm4qR
                )

            [error] => Array
                (
                    [0] => 0
                )

            [size] => Array
                (
                    [0] => 126867
                )

        )

)



print_r($_FILES) for problem image
FILES:Array
(
    [img] => Array
        (
            [name] => Array
                (
                    [0] => 94689121_1GPPZgCqPmI.jpg
                )

            [type] => Array
                (
                    [0] => 
                )

            [tmp_name] => Array
                (
                    [0] => 
                )

            [error] => Array
                (
                    [0] => 8
                )

            [size] => Array
                (
                    [0] => 0
                )

        )

)

1 回答

  • 0

    嗨错误代码8意味着:

    UPLOAD_ERR_EXTENSION
    
        Value: 8; A PHP extension stopped the file upload. PHP does not provide a way to ascertain which extension caused the file upload to stop; examining the list of loaded extensions with phpinfo() may help. Introduced in PHP 5.2.0.
    

    可能有用的事情:

    • 检查您的服务器是否安装了一些可能限制文件上传的额外安全模块(例如.Shosin提出了很多这些问题)

    • 检查是否正确设置了max_upload_filesize和post_max_size参数

    • 尝试检查某个特定文件是否发生此问题(例如,大文件,某些扩展名或某些文件名)或者它是否完全随机

相关问题