Parsing a multipart/form-data with a variable and a file


Hi, I’ve been trying to receive a multipart/form-data where I have a file and a variable, like this:

Content-Disposition: form-data; name="foto"

Content-Disposition: form-data; name="idUsuario"


I can access the values through the ->getParsedBody() method, but the ->getUploadedFiles() method can’t parse the file.

How can I solve this?


Do you get an error message when calling getUploadedFiles() or an empty return value?

In case you haven’t checked yet, there is an example in the docs, though the example only shows uploading files using a form.