Esri / ArcREST

python package for REST API (AGS, AGOL, webmap JSON, etc..)
Apache License 2.0
192 stars 155 forks source link

filename parameter wrongly assigned when adding Item #189

Closed SergStol closed 8 years ago

SergStol commented 8 years ago

I am having issues with filename parameter. When using addItem() after the successful upload if I go to that item on AGOL contents (FGDB in this case) and try to update it, the filename is the same as Title, missing a '.zip' extension in the name and hence it would not allow me to update the item even though it is exactly the same zipped FGDB I have uploaded.

name = 'FGDB_Upload' ip = arcrest.manageorg.ItemParameter()

ip.title = name ip.filename = name + '.zip' ip.type = "File Geodatabase" ip.tags = name

item = user.addItem(itemParameters=ip, filePath = "path to zipped FGDB", multipart = True)

I tried setting the filename parameter "name + '.zip', but it does not honor it. I noticed that if I set ip.title = name + '.zip', it would also set the filename to that and lets me start the update, however fails with an error

achapkowski commented 8 years ago

@SergStol - i'll take a look.

What version of ArcREST are you using?

SergStol commented 8 years ago

3.5.3/3.5.4 master copy downloaded on 03/03/2016

achapkowski commented 8 years ago

@SergStol - able to reproduce, I will try to figure out a fix. It appears that the extension gets dropped when saved on AGOL even when a file name is specified. Most likely an issue with the addByPart function the mulipartform class. I'll see what I find out.

achapkowski commented 8 years ago

@SergStol - issue resolved with latest commit to master