laptop and a wrench

Bug

Using the ArcGIS API for Python insert_layer() function to insert a file geodatabase with attachments fails in ArcGIS Online.

ArcGIS API for Python
Bug ID Number BUG-000167632
SubmittedMay 20, 2024
Last ModifiedAugust 15, 2024
Applies toArcGIS API for Python
Version found2.2.0
Operating SystemWindows OS
Operating System Version10.0 64 Bit
StatusAs Designed

Additional Information

The user need to pre-upload the attachments. The sample shows them trying to passing in the file path, which will not work. Refer to the documentation called Attachments to be added or updated can use either pre-uploaded data or base 64encoded data. There is also a link that describes how the attachments must be pre-uploaded.

Workaround

Create a blank feature service (feature layer), add a blank layer, and add features or attachments with the edit_features() function.

For example: new_feature_layer.layers[0].edit_features(

adds=[features],

use_global_ids=True,

attachments={"adds": sm_item2_attach})

Steps to Reproduce

Bug ID: BUG-000167632

Software:

  • ArcGIS API for Python

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options