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

**URL:** <https://discourse.slimframework.com/t/parsing-a-multipart-form-data-with-a-variable-and-a-file/2143>\
**Category:** Questions\
**Created:** [January 7, 2018, 1:23am UTC](https://discourse.slimframework.com/t/parsing-a-multipart-form-data-with-a-variable-and-a-file/2143 "2018-01-07T01:23:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![datovard](https://avatars.discourse-cdn.com/v4/letter/d/ecd19e/32.png) [@datovard](https://discourse.slimframework.com/u/datovard)\
**Post date:** [January 7, 2018, 1:23am UTC](https://discourse.slimframework.com/t/parsing-a-multipart-form-data-with-a-variable-and-a-file/2143/1 "2018-01-07T01:23:32Z")

</div>

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

```auto
------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?

---

<div class="post-metadata">

**Author:** ![llvdl](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/llvdl/32/78_2.png) [@llvdl](https://discourse.slimframework.com/u/llvdl)\
**Post date:** [January 10, 2018, 10:23pm UTC](https://discourse.slimframework.com/t/parsing-a-multipart-form-data-with-a-variable-and-a-file/2143/2 "2018-01-10T22:23:11Z")

</div>

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](https://www.slimframework.com/docs/cookbook/uploading-files.html) in the docs, though the example only shows uploading files using a form.
