I have a little problem with uploading multiple files in PHP ,
i have this html form:
<form method="post" action="upload.php" enctype="multipart/form-data">
<input type="file" name="myfile[]" />
<input type="submit" />
</form>
and this is the upload.php :
<?php print_r( $_FILES ); ?>
when i'm sending a file it show me this:
Array
(
[myfile] => Array
(
[name] => Array
(
[0] => Krw_Qe4QKmI.mp3
)
[type] => Array
(
[0] =>
)
[tmp_name] => Array
(
[0] =>
)
[error] => Array
(
[0] => 1
)
[size] => Array
(
[0] => 0
)
)
)
so far so good.
the problem starts when i upgrade my form to this one :
<form method="post" action="upload.php" enctype="multipart/form-data">
<input type="file" name="myfile[]" />
<input type="file" name="myfile[]" />
<input type="submit" />
</form>
now , when i send 2 files , it show me this :
Array
(
)
so , what's the problem here? thank you , Mor.
I would bet that you exceeded post_max_size
and PHP just ignored the uploaded files.
It's 8MB by default. If you try to upload one 5MB file everything will work. If you try to upload 2 5MB files, it exceeeds 8MB and PHP ignores posted data.
Try increasing the value of post_max_size in your php.ini.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With