אהלן ,
אני עכשיו עובד על איזה מערכת העלאת קבצים ויש לי נראה לי בעיה קטנה
יש לי טופס כזה:
HTML קוד:
<form method="post" action="upload.php" enctype="multipart/form-data">
<input type="file" name="myfile[]" />
<input type="submit" />
</form>
ו upload.php ככה :
PHP קוד:
<?php print_r( $_FILES ); ?>
עכשיו , כשאני שולח את הקובץ זה מראה לי בסדר , לדוגמא :
PHP קוד:
Array
(
[myfile] => Array
(
[name] => Array
(
[0] => Krw_Qe4QKmI.mp3
)
[type] => Array
(
[0] =>
)
[tmp_name] => Array
(
[0] =>
)
[error] => Array
(
[0] => 1
)
[size] => Array
(
[0] => 0
)
)
)
עד כאן זה טוב , אבל הבעיה מתחילה שאני מוסיף עוד קובץ להעלאה
לדוגמא עם הטופס הזה :
HTML קוד:
<form method="post" action="upload.php" enctype="multipart/form-data">
<input type="file" name="myfile[]" />
<input type="file" name="myfile[]" />
<input type="submit" />
</form>
והבעיה נראת שאני שולח את הטופס , מה שאני מקבל זה
עכשיו , שמתי לב כשאני שולח את אותו קובץ פעמיים
אני מקבל תוצאה כזו :
PHP קוד:
Array
(
[myfile] => Array
(
[name] => Array
(
[0] => Krw_Qe4QKmI.mp3
[1] => Krw_Qe4QKmI.mp3
)
[type] => Array
(
[0] =>
[1] =>
)
[tmp_name] => Array
(
[0] =>
[1] =>
)
[error] => Array
(
[0] => 1
[1] => 1
)
[size] => Array
(
[0] => 0
[1] => 0
)
)
)
וכשאני שולח רק קובץ אחד מתוך 2 אני מקבל ככה :
PHP קוד:
Array
(
[myfile] => Array
(
[name] => Array
(
[0] => Krw_Qe4QKmI.mp3
[1] =>
)
[type] => Array
(
[0] =>
[1] =>
)
[tmp_name] => Array
(
[0] =>
[1] =>
)
[error] => Array
(
[0] => 1
[1] => 4
)
[size] => Array
(
[0] => 0
[1] => 0
)
)
)
אז מה הבעיה פה שאני שולח 2 קבצים זה לא מראה כלום?
תודה , מור