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

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 :eyes:

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 :+1:

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?

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

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

Hope this helps.
//Erik