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