Select to view content in your preferred language

Add Attachments Via Rest API Assigning Incorrect Mime Type - Images

291
1
07-10-2022 08:20 PM
VH_MapS
New Contributor III

Hello, I am using FME to upload images (.JPG) as attachments to a hosted feature service (AGOL) using the HTTP Caller transformer and the ArcGIS REST API. The images are transferring just fine - but the server (AGOL side) is assigning the incorrect mime type.

The images are successfully uploaded, but the server assigns the incorrect mime type. This causes the images to download, and not display in the browser. I have tried manually setting the 'content_type' to 'image/jpeg', but the server seems to assign the mime type to 'application/octet-stream' every time.

I have been setting the 'content_type' parameter to 'image/jpeg' without success. I have also tried omitting this parameter - with no success.

Does anyone have any advice? Is there any obvious syntax items I'm overlooking?

Thanks!!!

0 Kudos
1 Reply
RenatoSalvaleon3
Esri Contributor

Responding in case another users stumbles into this question. Not exactly how @VH_MapS configured his transformer but I assume he used "Specify Upload  Body" like below.

RenatoSalvaleon3_1-1718054091930.png

Documentation states: "... it must be multi-part request..."
https://developers.arcgis.com/rest/services-reference/enterprise/add-attachment/

So the HTTPCaller should be configured as Multipart Form and that the MIME Type of the attachment must be configured in the Multipart Upload Value column, not the Content Type.

RenatoSalvaleon3_0-1718053963521.png

 




0 Kudos