I have an ArcGIS for Desktop Advanced license. I have an attachment enabled feature service in ArcGIS Online. I have thousands of files I wish to attach to it. By current process convention, these files are named according to 2 fields in the attribute table of the feature service (for current and future scripting needs).
What I CAN do:
- I can attach documents one by one to a local copy of the feature service using attachment manager and successfully sync those attachments.
- I can create a script that creates a match table for the AddAttachment tool with a field for the Object ID in the feature service and a field storing the file path.
- I can use this match table to attach all of these files to the local copy of the feature service at once.
What I CANNOT do:
- Successfully sync this local copy and all of its new attachments to ArcGIS Online.
The Add Attachment tool and its associated arcpy function require the file geodatabase to be outside of an edit session to run. My first guess as to why, after running this tool successfully on a local copy of an AGOL layer, the results can't be sync'ed has to do with it being run outside of an edit session. I'm guessing (but don't actually know) that Desktop -> AGOL sync process sends over the instruction set performed during edit sessions (the attachment manager process for adding attachments requires an edit session). The actions performed outside of an edit session are simply not sent through the sync process, meaning any tools that can't be run in an edit session, like Add Attachments, can't be sync'ed to AGOL.
Is there a known way to attach to an ArcGIS Online feature service in bulk, whether through arcpy, REST service, or some other tool I don't know of?