There are new tools in 10.1 to do a batch attachment but there are times where it would be useful to export out all the attachments associated to selected features in a featureclass. At the moment the only way to save attachments to file is to click on each feature and use the attachment manager to save the file(s). This is very tedious and slow if you're dealing with hundreds of features or hundreds of attachments.
Agreed, strange that this idea needs so long to be implemented.
41763 - Batch export attachments from a feature class
You may find the link breaks - please notify the site administrator if so.
I batch exported a bunch of photos from my feature class using the script bruce harold references (better link here).
However that didn't do exactly what I needed it to do, I needed the feature classes ID to be exported with images so that people without ArcGIS could access and understand them. Thus I took this route, a little cumbersome but gets the job done.
The result is a folder of jpeg's, named with the PT_ID and the Photo number
This batch export attachments from a feature class script gives an error with ArcMap 10.5.1:
Traceback (most recent call last):
File "E:\GIS\riverpoints\ExportAttachments.py", line 12, in <module>
filename = filenum + str(item[1])
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 3: ordinal not in range(128)
Failed to execute (ExportAttachments).
This idea has been posted since 2012, is there any progress as to exporting attachments using a selected table field name and exporting to a folder?
I have multiple photos per feature and would be nice to export to a folder on my computer with an associated name,
I would probably black out from the excitement of actually accomplishing this....would be huge.
Don, one of the easiest methods I have come up with is to rename the attachment in the attachment table using whatever convention you like. You just have to make sure that it is unique. Then using the simple script that's been linked to above, it'll export your attachments using the attachment name that you have changed. I usually join the attachment table to my feature class table and use values from that concatenated together to create my file names.
Another script is available which downloads attachments directly from hosted Feature Layers in ArcGIS Online: Downloading Feature Layer Attachments via the ArcGIS API for Python
It's likely I'll enhance this in the coming months to allow users use an attribute as part of the attachment output name, and also make it available as a toolbox for ArcGIS Pro.
I have used a couple of different variants of this Python script. The only issue I have had with it is that it throws an unclear error when encountering corrupted attachment files.
Looks like this article was updated for ArcGIS Pro: How To: Batch export attachments from a feature class in ArcGIS Pro
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.