Not able to get tmp_name ($_FILES) of file in smart phone

Milan asked
php arrays file
via

Here, is my html form :

<form method="post" action="filename.php" enctype="multipart/form-data">
     <input id="file_upload" name="image[]" value="Upload" multiple="" type="file">
     <button type="submit">Submit</button>
</form>

When I print $_FILES in filename.php file then I am able to get below array in PC :

Array
(
[name] => Array
    (
        [0] => Sket-printed-shirt.jpg
    )

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

[tmp_name] => Array
    (
        [0] => /tmp/phpSA6YF5
    )

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

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

)

But getting below array in smart phones like : Motorola G4 plus , G5 plus and HTC one mini 2

Array
(
[name] => Array
    (
        [0] => Sket-printed-shirt.jpg
    )

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

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

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

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

 )


Answer
via

The reason you don’t have tmp_name there is because the upload failed with error code 1, which indicates the file was too large. See: upload file error codes.

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

Share This
Posted in: