Created
October 6, 2014 15:25
-
-
Save amarinelli/c1941399cd6439cb5257 to your computer and use it in GitHub Desktop.
Export BLOB feature class attachments to folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from arcpy import da | |
import os | |
inTable = r'Database Connections\[email protected]\GISDB.SDE.Canada__ATTACH' | |
fileLocation = r"C:\Users\AMarinelli\Downloads\blob" | |
with da.SearchCursor(inTable,['DATA','ATT_NAME']) as cursor: | |
for row in cursor: | |
binaryRep = row[0] | |
fileName = row[1] | |
# save to disk | |
open(fileLocation + os.sep + fileName, 'wb').write(binaryRep.tobytes()) | |
del row | |
del binaryRep | |
del filename |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment