When exporting batch attachments from an ArcGIS Online layer, how do I create individual folders per point?

403
0
08-05-2020 12:23 PM
by Anonymous User
Not applicable

When exporting batch attachments from an ArcGIS Online layer, I use the code from this GeoNet suggestion: 

https://support.esri.com/en/technical-article/000017450 . From here, I want to change the code to create individual folders for each point's attachments. Can anyone help me do this? I'm not knowledgeable of ArcPy, but here is the code in the tool created:

import arcpy from arcpy import da import os  inTable = arcpy.GetParameterAsText(0) fileLocation = arcpy.GetParameterAsText(1)  with da.SearchCursor(inTable, ['DATA', 'ATT_NAME', 'ATTACHMENTID']) as cursor:     for item in cursor:         attachment = item[0]         filenum = "ATT" + str(item[2]) + "_"         filename = filenum + str(item[1])         open(fileLocation + os.sep + filename, 'wb').write(attachment.tobytes())         del item         del filenum         del filename         del attachment
0 Kudos
0 Replies