You can see most of (perhaps all of) the information in your attachment table Foto__ATTACH. I have yet to find a way to edit the attachment table.
To view the information, log into your AGOL account. At the top of the page select "Content". On the next page, under "Layers", select the layer that has your attachments.
This will take you to the REST Services Directory page for your layer. At the bottom of the page, click the link "Query Attachments". (This link is only available if the layer has attachments.)
The form will look like the following image. In the box "Definition Expression" enter "OBJECTID > 0". This will basically create a where clause: "where the OBJECTID of the parent table is greater than zero" and select all attachments. You can limit the attachment types to "image/jpeg" if there are other types of attachments you
do not need.
You should get links for the selected images which you can click and save the target. It appears that all photos are renamed to "attachment##" when Collector attaches them to the parent table. I do not know if this field can be edited. You should see the information in the attachment table for each photo, but it will not be in a table format. ID is the number of each row in the table; and there is a global ID for the attachment. You can also see the parent's ObjectID and GlobalID.
The above process can be scripted in Python, although I have not done it yet. For additional information see this section in the REST API: Query Attachments (Feature Service/Layer).
If you are wanting to export all photos and rename them, it may be easier to click "Export Data" option on the feature's page that shows the layers. You can save it as a file geodatabase (zipped) and work with it in
desktop. This way you can work with the Foto_ATTACH table directly. I have used the following script to export and rename jpeg's from the related attachment table.
import arcpy, os, exifread
masterFC = r'C:\path\to\file.gdb\parent'
masterFlds = ['GlobalID', 'OBJECTID', 'Note']
masterDict = {r[0]:(r[1:]) for r in arcpy.da.SearchCursor(masterFC, masterFlds)}
relatedTbl = r'C:\path\to\file.gdb\photo__ATTACH'
relatedFlds = ['REL_GLOBALID', 'ATTACHMENTID', 'DATA', 'CONTENT_TYPE']
fileLocation = r'C:\path\to\attachments\folder'
with arcpy.da.SearchCursor(relatedTbl, relatedFlds) as cursor:
for item in cursor:
if item[3] == 'image/jpeg':
f1 = masterDict[item[0]][0]
f2 = item[1]
filename = "ATT_{}_{}".format(f1, f2)
tempname = os.path.join(fileLocation, '{}.jpg'.format(filename))
f = open(tempname, 'wb').write(item[2].tobytes())
f = open(tempname, 'rb')
tags = exifread.process_file(f)
f.close()
if tags['Image DateTime'] is not None:
theDate = str(tags['Image DateTime']).split(' ')[0].replace(':','')
newname = os.path.join(fileLocation, "{}_{}.jpg".format(filename, theDate))
print "ObjectID: {} \tNotes: {} \tFile: {}".format(f1, masterDict[item[0]][1], newname)
os.rename(tempname, newname)
else:
print "ObjectID: {} \tNotes: {} \tFile: {}".format(f1, masterDict[item[0]][1], tempname)
del cursor
del item
For my test, the results were:
ObjectID: 263 Notes: attachment test File: C:\attachments\ATT_263_1_20170910.jpg
ObjectID: 263 Notes: attachment test File: C:\attachments\ATT_263_2_20170910.jpg
ObjectID: 264 Notes: attach test File: C:\attachments\ATT_264_3_20170627.jpg
Please note that I have not worked with missing exif information so I don't know how exifread will respond. It should be possible to include a few lines of code to use the attachment's ID to change the filename in the attachment table.