AnsweredAssumed Answered

Download photos as attachments

Question asked by on Jul 28, 2017
Latest reply on Aug 2, 2017 by

We have been working on python/reportlab scripts to create custom PDF reports of features. Based on the unique id of a record the related signatures and photos are downloaded and attached. The related photos have the same parentglobalid as the globalid of the parent record and can therefore be linked.



     'parentglobalid': '1bd4647f-44f1-43c9-820d-ef91b42fd37c',

     'objectid': 5,

     'globalid': u'c620f95b-0d9b-4775-bada-858d34718d7b',

     'Creator': u'<creatornaam>',

     'EditDate': 1500029670862L,

     'Editor': <editornaam>',

     'CreationDate': 1500029670862L




Using the objectid of the attachment a specific URL for the photo can be constructed as can be seen below.


The 5 is derived from the objectid, we were assuming the last number would always need to be the same. However if someone uploads an extra photo to a webmap the last number will become 1 higher and not the same anymore as the objectid:


Our question is how we can know the last number?


Too bad we just found out that the last release supports custom reports. Our report works great except for the attached photos described above.