TransWikia.com

Overwrite a PDF item type with ArcGIS API for Python

Geographic Information Systems Asked by Mick_eh on January 9, 2021

I’m trying to overwrite an existing PDF ArcGIS Online item using ArcGIS API for Python.

props = {
    "type":"PDF",
    "title":file_name,
    "overwrite":True
    }

data = os.path.join(tempFolder, "{}.pdf".format(file_name))

gis.content.add(item_properties=props, data=data)

Returns

RuntimeError: Item already exists

One Answer

props = {
    "type":"PDF",
    "title":file_name,
    "overwrite":True
    }

data = os.path.join(tempFolder, "{}.pdf".format(file_name))

item = gis.content.get('itemuniqueid')
item.update(item_properties=props, data=data)

More info can be found in the arcgis api reference reference.

Correct answer by Mick_eh on January 9, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP