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


#1

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

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

data:image/jpeg;base64,...
------WebKitFormBoundarytRxkCa0PPw7LwdRw
Content-Disposition: form-data; name="idUsuario"

11
------WebKitFormBoundarytRxkCa0PPw7LwdRw--

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

How can I solve this?


#2

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.