# Unable to determine file type when using FileData field of File Object Class

**URL:** <https://community.appfarm.io/t/unable-to-determine-file-type-when-using-filedata-field-of-file-object-class/1199>\
**Category:** Ask the community\
**Created:** [April 26, 2024, 11:44am UTC](https://community.appfarm.io/t/unable-to-determine-file-type-when-using-filedata-field-of-file-object-class/1199 "2024-04-26T11:44:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![oyvind.byhring](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/oyvind.byhring/32/1060_2.png) [@oyvind.byhring](https://community.appfarm.io/u/oyvind.byhring)\
**Post date:** [April 26, 2024, 11:44am UTC](https://community.appfarm.io/t/unable-to-determine-file-type-when-using-filedata-field-of-file-object-class/1199/1 "2024-04-26T11:44:38Z")

</div>

I’m trying to upload a file to an external API, which requires me to upload binary data.

I assumed I could use the FIleData field of my document, but the response I get from the API is

> [BadRequest] Could not determine content type. Supported content types: [‘application/pdf’, ‘image/jpeg’, ‘image/png’, ‘image/tiff’]

I realize this isn’t technically an Appfarm issue, but I was wondering if the contents of FileData include the metadata about file type/name, or if it’s just the binary data of the file?

The documentation doesn’t seem to mention this field in great detail 👀

Edit: After researching it seems like the binary file data shouldn’t include file name or type, so I’m back to looking for the error in other places now 👍

---

<div class="post-metadata">

**Author:** ![ErikAKSkallevold](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/erikakskallevold/32/1378_2.png) [@ErikAKSkallevold](https://community.appfarm.io/u/ErikAKSkallevold)\
**Post date:** [April 28, 2024, 3:03pm UTC](https://community.appfarm.io/t/unable-to-determine-file-type-when-using-filedata-field-of-file-object-class/1199/2 "2024-04-28T15:03:35Z")

</div>

Hi,

This information is available on the `mime-type` properties on `File Objects`. Have you attempted to databind the `mime-type` as a request header on your web request?

 ![bilde](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/d/d315b8e39c18abe95017393c36d23c357f11e7c6.png)

Remember to set the `Content-Type` on the web request action node to `Custom`.

 ![bilde](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/6/6c947d999e1d64dfe8ef96ddce86f9afc8da0f0d.png)

When doing this, my file is successfully sent with the correct Content-Type header. I use webhook.site to test this.

 ![bilde](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/d/d5de35e3ce250a45152a4556477373f120706501.png)

Hope this helps.  
//Erik
