I am facing a very strange behavior when uploading 2 (or more) files of types GIF and PNG with one POST request per file. Requests are run in parallel.
When I upload one GIF and one PNG, the $_FILES array say the GIF file has the "image/png" type (while keeping the .gif extension).
The type of the PNG file is correct : "image/png".
Here is a dump of the $_FILES array :
[2022-03-24 08:33:03] local.DEBUG: array (
'file' =>
array (
'name' => 'news_avril_t1_mobile_02.gif',
'type' => 'image/png',
'tmp_name' => '/tmp/phpk18oS2',
'error' => 0,
'size' => 43124,
),
)
[2022-03-24 08:33:06] local.DEBUG: array (
'file' =>
array (
'name' => 'news_avril_t1_mobile_04.png',
'type' => 'image/png',
'tmp_name' => '/tmp/phpvYCxk5',
'error' => 0,
'size' => 8168,
),
)
There is no problem when uploading the GIF alone, or when uploading the GIF with a JPEG, or another GIF.
And of course, I did check that GIF is really a GIF (not a PNG file with the gif extension).
The problem only occurs when uploading a GIF with a PNG.
Any idea anyone?