Hello,
when I pass some files to a .php using a <input type="file" id="file-upload" name="userfile[]" multiple required>
in a html form, using the official php:8.1-apache image, I don’t get the last ['tmp_name']
but when I use apache directly I don’t have this problem.
More specifically $_FILES['userfile']['tmp_name'][count($_FILES['userfile']['tmp_name'])-1] == ""
.
For example when inputting 4 file:
foreach ($_FILES['userfile']['tmp_name'] as $key => $name) {
echo $key." => ".$name;
}
will print:
0 => /tmp/php8FKarG
1 => /tmp/phpOhH1yJ
2 => /tmp/phprieejH
3 =>
Using directly apache I get:
0 => C:\xampp\tmp\php6B03.tmp
1 => C:\xampp\tmp\php6B04.tmp
2 => C:\xampp\tmp\php6B05.tmp
3 => C:\xampp\tmp\php6B16.tmp
Doing the same with ['name']
returns the correct filename of all 4 files in both cases but not with ['tmp_name']
that is missing most of the times on the last element when using docker.
Why does this happen?