AttachmentManager download fails with Attribute Error

592
1
Jump to solution
11-11-2019 10:37 PM
DonMorrison1
Occasional Contributor III

I'm getting an error *** AttributeError: 'list' object has no attribute 'to_dict' when I call arcgis.features.managers.AttachmentManager.download. I'm quite sure I have a valid attach manager object because I can list the attachments and add new attachments with no problem. I've tried all the combinations of input parameters I can think of with the same results, but no parameters as shown below should be valid.

import arcgis.features
tb_url = 'https://utility.arcgis.com/usrsvcs/servers/af1446382d3f441f859c305d15601085/rest/services/ROW_testing/UIC/FeatureServer/6'
tb = arcgis.features.Table(tb_url, gis=None)
att_mgr = tb.attachments
att_mgr.download()

0 Kudos
1 Solution

Accepted Solutions
DonMorrison1
Occasional Contributor III

Good news. I got this to work and it was evidently my fault...  I removed all the attachments and re-uploaded them using the AGOL UI instead of however I attached them before. The AGOL feature layer is a proxy and sends all requests to a REST endpoint on our ArcGIS server which is where the database lives. I think I did the previous uploads on the ArcGIS server and must have done something wrong - the Python API could see them but was generating a bad URL to download them. 

View solution in original post

0 Kudos
1 Reply
DonMorrison1
Occasional Contributor III

Good news. I got this to work and it was evidently my fault...  I removed all the attachments and re-uploaded them using the AGOL UI instead of however I attached them before. The AGOL feature layer is a proxy and sends all requests to a REST endpoint on our ArcGIS server which is where the database lives. I think I did the previous uploads on the ArcGIS server and must have done something wrong - the Python API could see them but was generating a bad URL to download them. 

0 Kudos