Hello,
I would like the ability to add or update a non-spatial item like a pdf from my computer to My Content in AGOL through a python script. We have an agol organizational account, but not arcgis enterprise. Does anyone know if this is possible?
Solved! Go to Solution.
The following code snippet worked for me:
from IPython.display import display
from arcgis.gis import GIS
import os
gis = GIS("https://www.arcgis.com", "MyUsername", "MyPassword")
pdfdata = "C:\\SomePath\\SomeFolder\\SomeFile.pdf"
pdfprop = {'title':'something','description':'this is a thing','tags':'tag','type':'PDF'}
pdf Doc = gis.content.add(item_properties = pdfprop , data = pdfdata)
The following code snippet worked for me:
from IPython.display import display
from arcgis.gis import GIS
import os
gis = GIS("https://www.arcgis.com", "MyUsername", "MyPassword")
pdfdata = "C:\\SomePath\\SomeFolder\\SomeFile.pdf"
pdfprop = {'title':'something','description':'this is a thing','tags':'tag','type':'PDF'}
pdf Doc = gis.content.add(item_properties = pdfprop , data = pdfdata)
I used this same script to upload a kml file but noticed when I do so it does not generate a Data Source URL in the item properties. Any ideas?