Skip to main content
Solved

Adding attachments with ArcGISAttachmentConnector 3.9.5 not working with ArcGIS Enterprise

  • July 28, 2025
  • 1 reply
  • 51 views

stezi
Contributor
Forum|alt.badge.img+6

Hello,

I want to report a bug related to adding attachments to a feature in an ArcGIS Enterprise Feature Service using the ArcGISAttachmentConnector in the latest version.

I receive the following error:

(C:\Users\x\AppData\Roaming\Safe Software\FME\Packages\25606-win64\python\safe.esri-agol\fmepy_esri_agol\attachments\handler.py:104) add_attachment
    return AttachmentResult.from_dict(response.get("addAttachmentResult", {}))
                                      ^^^^^^^^^^^^
910523  Python Exception <AttributeError>: 'generator' object has no attribute 'get'

The problem is that the ArcGIS REST API addAttachment endpoint returns text/html instead of json. This appears to happen specifically for Enterprise Feature Services, as described here. As a result, the result cannot be decoded. However, the attachment is actually uploaded successfully.

Bug fix:

Change the line 43 from

files = {"attachment": (filename, file_obj, mime_type))}

to

files = {"attachment": (filename, file_obj, mime_type), "f": (None, "json")}

in C:\Users\x\AppData\Roaming\Safe Software\FME\Packages\25606-win64\python\safe.esri-agol\fmepy_esri_agol\attachments\api.py

 

I just tested addAttachment but it may also occur for updateAttachment.

 

Esri ArcGIS Connector: https://hub.safe.com/publishers/safe/packages/esri-agol/versions/3.9.5

FME(R) 2025.1.0.0 (20250704 - Build 25606 - WIN64)

ArcGIS Enterprise 11.5

Best answer by crystalatsafe

Hi ​@stezi 

I believe this issue was fixed in version 3.9.8 of the Esri ArcGIS Connector package.
Can you please try updating the package (Tools -> FME Options -> FME Packages -> Select Esri ArcGIS Connector -> Check for Updates -> Update) and let me know if this resolves the issue for you. 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

crystalatsafe
Safer
Forum|alt.badge.img+26
  • Safer
  • Best Answer
  • August 1, 2025

Hi ​@stezi 

I believe this issue was fixed in version 3.9.8 of the Esri ArcGIS Connector package.
Can you please try updating the package (Tools -> FME Options -> FME Packages -> Select Esri ArcGIS Connector -> Check for Updates -> Update) and let me know if this resolves the issue for you.