Hey all,
I've found the need to sync an AGOL hosted feature layer with attachments to our local DB. I've pull the FGDB and loaded it onto the DB, and created a Python script using the ArcGIS API for Python, to sync the points and features, but I'm now lost for how I would bring the attachments over. I've found the documentation on how to actually access these through the API for Python, but I haven't found how to get these over.
I'm using SQL Server 2019, newest ArcGIS Pro, and I have access to ArcPy.
Any suggestions?
Thanks in advance!
Cody
Solved! Go to Solution.
Broadly speaking, you'll probably need to use the API to "download" the attachments into memory in a script, and then use Add Attachments to add them to the Feature Class in the DB.
If you need specific help, let me know, but I'm a little rusty on the API.
Broadly speaking, you'll probably need to use the API to "download" the attachments into memory in a script, and then use Add Attachments to add them to the Feature Class in the DB.
If you need specific help, let me know, but I'm a little rusty on the API.
There are also geoprocessing tools that allow you to bulk export and add attachments, these tools do respect selected features (even when run standalone) so you'll use layers to manage which attachments to export.
You can also do this using the ArcGIS API for Python to individual download and add attachments between the two environments.
For this, I use arcpy.append with Maintain Attachments = True.
R_