I'm facing an issue trying to send multiples files from a ReactJS App to a Symfony Backend.
I upload two files but only one is visible in my Symfony backend.
Data are sent from a ReactJS dropzone, I well checked that the two files are sent via formData
, I well used the 'content-type': 'multipart/form-data'
to post the data.
In Chrome Newtwork Tab, the Form Data details shows that two files are well attached to the request :
------WebKitFormBoundaryTif9sihCtI30UXXS Content-Disposition: form-data; name="file"; filename="glacier-583419_960_720.jpg" Content-Type: image/jpeg
------WebKitFormBoundaryTif9sihCtI30UXXS Content-Disposition: form-data; name="file"; filename="image-ile.jpg" Content-Type: image/jpeg
Nevertheless, in my Symfony backend the File Parameter Bag only shows one file :
return $request->files;
Serialized response :
{
"parameters": {
"file": {
"test": false,
"original_name": "glacier-583419_960_720.jpg",
"mime_type": "image/jpeg",
"error": 0
}
},
"file_keys": [
"error",
"name",
"size",
"tmp_name",
"type"
]
}
As you can see, in "parameters", only one file is present instead of two.
Is anybody already encountered this problem ? I don't have any idea of what could be the issue ?