Update Thumbnail for AGO Item (web map/web app) using python api gis.item.update file not found error

647
2
Jump to solution
03-12-2021 11:43 AM
EdApalinski
Occasional Contributor

Hi,

I am trying to use the .update(thumbnail) as described in the ArcGIS API for Python

# updating thumbnail
volcanoes_item.update(thumbnail=r'pathway\to\your\directory\IMAGE_NAME.jpg')

 however I am getting a File not found error.  my statement and a copy of the error are below.  Any advise will be greatly appreciated!

Capture.PNG

 

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Notable Contributor

It looks like you're running the code from an ArcGIS Online Notebook, is that correct?

If you are:

In order for the notebook to access the file you want to update the thumbnail with, the python kernel running in the notebook needs to be able to see that directory. If you're using an AGOL notebook, it's actually in a container on a server machine, and won't have that sort of access.

You'll have to add the files to the file directory that's part of the notebook's container, using the Files tab.

jcarlson_0-1615583928259.png

You can then access that file with the path to the directory in the files tab, or click the "+" icon to add it to a cell in your notebook.

Let me know if you're not using the AGOL / Portal notebook, as that might indicate a totally different problem.

- Josh Carlson
Kendall County GIS

View solution in original post

2 Replies
jcarlson
MVP Notable Contributor

It looks like you're running the code from an ArcGIS Online Notebook, is that correct?

If you are:

In order for the notebook to access the file you want to update the thumbnail with, the python kernel running in the notebook needs to be able to see that directory. If you're using an AGOL notebook, it's actually in a container on a server machine, and won't have that sort of access.

You'll have to add the files to the file directory that's part of the notebook's container, using the Files tab.

jcarlson_0-1615583928259.png

You can then access that file with the path to the directory in the files tab, or click the "+" icon to add it to a cell in your notebook.

Let me know if you're not using the AGOL / Portal notebook, as that might indicate a totally different problem.

- Josh Carlson
Kendall County GIS
EdApalinski
Occasional Contributor

Thanks!  I am using an AGOL notebook and adding the file to the files tab in the notebook did the trick!

Best! and have a great weekend!