Hi everyone,
I would like to ask you about help. Maybe you have some solutions already. How could I export/extract few attachments for selected features from geodatabase? I tried use python scripts but no results. Thanks for help.
Attached is a zip file that contains a toolbox with a GP tool you can run to export the attachments.
Is there a way to do this without adding to the original attachment name? For example the original attachment name is image_downstream-0c6729a48c7f4735813318cbce71957b but when I run the tool all the attachments have a series of numbers at the end (image_downstream-0c6729a48c7f4735813318cbce71957b_{66F1D494-DBED-4B26-8E9B-F5627F862DCA}). Thanks!
Hi Jake,
This script worked beautifully except for one thing that I need. Is there anyway to augment the script to change the name of the file to a parcel number in a related table or to include the parcel number in the attributes for the exported file? Thank you for your help!
-Joe
I get something like this.
How should I excute it? I`m not good of using scripts.
Hi Bartosz,
Here is an example how to do this using python:
import os, arcpy tbl = r"C:\Temp\Python\Test.gdb\Graffiti__ATTACH" fldBLOB = 'DATA' fldAttName = 'ATT_NAME' outFolder = r"C:\Temp\Python\Attachments" with arcpy.da.SearchCursor(tbl,[fldBLOB,fldAttName]) as cursor: for row in cursor: binaryRep = row[0] fileName = row[1] # save to disk open(outFolder + os.sep + fileName, 'wb').write(binaryRep.tobytes()) print 'Finished'
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.