PHP $ _FILES [' name'] [' type']返回空值

时间:2018-06-08 14:01:57

标签: php

所以我尝试一次上传多个mp3文件,只上传了一个。{p>我做了一些跟踪,结果发现由于某种原因,某些文件类型返回空值,所以我认为结果是它们没有被上传。虽然我不太确定,但我的研究结果并不多,因为我现在还不确切知道要研究什么。

这是我上传多个mp3文件时返回的数组。

Array
(
    [name] => Array
        (
            [0] => a.mp3
            [1] => e.mp3
            [2] => s.mp3
        )

    [type] => Array
        (
            [0] => 
            [1] => audio/mp3
            [2] => 
        )

    [tmp_name] => Array
        (
            [0] => 
            [1] => /private/var/tmp/phpfqxWTx
            [2] => 
        )

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

    [size] => Array
        (
            [0] => 0
            [1] => 1908445
            [2] => 0
        )

)

1 个答案:

答案 0 :(得分:1)

您刚刚检查过最相关的字段error

UPLOAD_ERR_INI_SIZE

Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini.

Error Messages Explained