Home:ALL Converter>PHP $_FILES['name']['type'] returning empty value

PHP $_FILES['name']['type'] returning empty value

Ask Time:2018-06-08T22:01:57         Author:nTuply

Json Formatter

So I'm trying to upload multiple mp3 files at once and only one was being uploaded. I did some tracing and it turns out that for some reason, some of the file types are returning empty values, so I think as a result they are not being uploaded. I'm not too sure though and my research hasn't yielded much because I don't know exactly what to research at this point.

Here's the array that's being returned when I upload multiple mp3 files.

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
        )

)

Author:nTuply,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/50762378/php-filesnametype-returning-empty-value
yy