Hallo ... ... ich melde mich mal wieder zu Wort...
Also:
Ich speichere eine noch nicht festgelegt Anzahl von Dateien zum Upload
Funktioniert
Ergebnis:
Diese Dateien möchte ich nun (natürlich) weiterverarbeiten.
Ich hatte an foreach gedacht.
So geht's nicht
foreach erwartet doch ein Array. Das letzte Beispiel müßte damit doch laufen ? Fehlermeldung:
Frage: Haut das mit foreach irgendwie hin (bin ich blind
)
Oder muss ich erst irgendwie die Inhaltselemente Zählen
und dann mit for arbeiten.
Ähmmmm... ... schonmal Daaaaaaaaaaanke
Also:
Ich speichere eine noch nicht festgelegt Anzahl von Dateien zum Upload
PHP-Code:
<?php
<input name="userfile[]" type="file" title="Durchsuchen...">
?>

Ergebnis:
Array
(
[userfile] => Array
(
[name] => Array
(
[0] => php_manual_de.tar.tar
[1] => php_tutorial.pdf
)
[type] => Array
(
[0] => application/x-tar
[1] => application/pdf
)
[tmp_name] => Array
(
[0] => /tmp/php8KXYe0
[1] => /tmp/phpyLNefl
)
[error] => Array
(
[0] => 0
[1] => 0
)
[size] => Array
(
[0] => 2632029
[1] => 215079
)
)
)
(
[userfile] => Array
(
[name] => Array
(
[0] => php_manual_de.tar.tar
[1] => php_tutorial.pdf
)
[type] => Array
(
[0] => application/x-tar
[1] => application/pdf
)
[tmp_name] => Array
(
[0] => /tmp/php8KXYe0
[1] => /tmp/phpyLNefl
)
[error] => Array
(
[0] => 0
[1] => 0
)
[size] => Array
(
[0] => 2632029
[1] => 215079
)
)
)
Ich hatte an foreach gedacht.
So geht's nicht
PHP-Code:
<?php
foreach($FILES as $test) ...
foreach($FILES['userfile'] as $test) ...
foreach($FILES['userfile']['name'] as $test) ...
?>
Invalid argument supplied for foreach()

Oder muss ich erst irgendwie die Inhaltselemente Zählen
und dann mit for arbeiten.
Ähmmmm... ... schonmal Daaaaaaaaaaanke
Kommentar