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.
1
). See here for what it means: php.net/manual/en/features.file-upload.errors.php – Pekka 웃 Sep 18 '11 at 19:27