I am able to export photo attachments with the generic script but I would like to name them based on a field on the record they are attached to. The field I would like to use is 'FID' and it's unique to each row in the table. The current code I use is.
from arcpy import da
inTable = arcpy.GetParameterAsText(0)
fileLocation = arcpy.GetParameterAsText(1)
with da.SearchCursor(inTable, ['DATA', 'ATT_NAME', 'Access Point FQN_ID']) as cursor:
for item in cursor:
attachment = item
filenum = "ATT" + str(item) + "_"
filename = filenum + str(item)
open(fileLocation + os.sep + filename, 'wb').write(attachment.tobytes())