Exported FGDB from AGOL and TODAY the photo dates are the same

70
6
04-02-2020 02:35 PM
Highlighted
Occasional Contributor III

This isn't normal, something has changed in the last month.

I run a Python script to extract the photos, and these dates should be the date is taken, which helps me eliminate the oldest photos, but this is what I see in April.

Last month I saw this, PLEASE help.

Tags (1)
Reply
0 Kudos
6 Replies
Highlighted
Esri Esteemed Contributor

Hi Michelle,

Which Python script do you use?  Does it download a file geodatabase containing the photos, or does it access the photos directly from the feature service?  Understanding that may help track down what is occurring.  I'll also note that if this is working off a feature service in ArcGIS Online, there was an ArcGIS Online update recently that may have changed the behavior of some operations.

Reply
0 Kudos
Highlighted
Occasional Contributor III

Here's a sample of the code I'm using to open the geodatabase once downloaded from AGOL. This has never happened before, so I think that something changed with the downloaded geodatabase, not the script. Thank you for your help James, I hope to meet you at the UC.


inTable = r'C:\Users\...'
inTable2 = r'C:\Users\...\Inspection.gdb\Inspection'
fileLocation = r'C:\Users...\Inspection'

with da.SearchCursor(inTable, ['DATA', 'ATT_NAME', 'ATTACHMENTID','REL_GLOBALID']) as cursor:
for item in cursor:
attachment = item[0]
filenum = str(item[3]) + "_"
filename = filenum + str(item[1])
open(fileLocation + os.sep + filename, 'wb').write(attachment.tobytes())
del item
del filenum
del filename
del attachment


arcpy.TableToExcel_conversion(Input_Table=inTable2, Output_Excel_File="C:\Users...Inspection\inspection.xls", Use_field_alias_as_column_header="ALIAS", Use_domain_and_subtype_description="CODE")


time.sleep(1)
done = True

Reply
0 Kudos
Highlighted
Esri Esteemed Contributor

Hi Michelle,

Can you look at the attachments table and manually save the photo to see if the date is as you expected?  From a base reading of your script, I would have expected it to create the new files with the timestamp of when the program is run (not when the photo was taken), so I'm surprised you had the date the photo was taken previously.

Reply
0 Kudos
Highlighted
Occasional Contributor III

Thanks, James,

When I manually download the images, the created date and the modified date are today's date and time. 

As a 2nd option, would Esri add a column to the attachment table for the creation date?

Reply
0 Kudos
Highlighted
Occasional Contributor III

Hello James, 

I'm getting ready to run this month's reports on the 1st, so I downloaded the FGDB to check on the dates. The dates are still today's date. Is there anyone looking into this, or will Esri add a Date Taken to the Inspection__ATTACH table? Thanks in advance.

~ Michelle 

Reply
0 Kudos
Highlighted
Occasional Contributor III

Thanks to my 17-year-old for sharing WHY my dates weren't correct. I hope this will help others.

The last Windows update reset my headers and removed my Date Taken header. I didn't realize that Date Created wasn't the actual date created.

Reply
0 Kudos