Select to view content in your preferred language

How do I batch upload images to AGOL?

5051
4
Jump to solution
04-10-2018 04:19 AM
NevinWilson1
New Contributor II

There are approx 200 images (less than 1MB in size) in JPG and BMP format. They are non-georeferenced, site photos I would like AGOL to host the images so that I can invoke them using URLs in pop-ups in my web app.

Once I have the URL for each image, I store them in a CSV, TXT or other similar file, so that I can join this to an existing feature class in ArcMap prior to publishing as a feature service to AGOL.

Any help would be much appreciated!

Thanks

Nevin

1 Solution

Accepted Solutions
KellyGerrow
Esri Frequent Contributor

Hi Nevin,

If you are looking to batch upload some file content (images), you will need to automate this either using the ArcGIS API for Python or Rest API requests.

If you are using the REST API, you'll need to use the add item call: 

Add Item—ArcGIS REST API: Users, groups, and content | ArcGIS for Developers 

You will also need to share each item with everyone in order to access the url to the data:

Share Item (as item owner)—ArcGIS REST API: Users, groups, and content | ArcGIS for Developers 

You can find samples of the ArcGIS API here:

arcgis.gis module — arcgis 1.4.0 documentation 

This is the location of a very basic Rest API python script:

http://cloudygis.maps.arcgis.com/home/item.html?id=f3d6a950eb8e4a07a22e0730fd6a787b 

-Kelly

View solution in original post

4 Replies
KellyGerrow
Esri Frequent Contributor

Hi Nevin,

If you are looking to batch upload some file content (images), you will need to automate this either using the ArcGIS API for Python or Rest API requests.

If you are using the REST API, you'll need to use the add item call: 

Add Item—ArcGIS REST API: Users, groups, and content | ArcGIS for Developers 

You will also need to share each item with everyone in order to access the url to the data:

Share Item (as item owner)—ArcGIS REST API: Users, groups, and content | ArcGIS for Developers 

You can find samples of the ArcGIS API here:

arcgis.gis module — arcgis 1.4.0 documentation 

This is the location of a very basic Rest API python script:

http://cloudygis.maps.arcgis.com/home/item.html?id=f3d6a950eb8e4a07a22e0730fd6a787b 

-Kelly

JulesKarasira
New Contributor II

Thank you for your help!

I am trying to upload batch of images (from my desktop), and I trying to run the codes from the below link you provided:

(additems.py) ==>  http://cloudygis.maps.arcgis.com/home/item.html?id=f3d6a950eb8e4a07a22e0730fd6a78...

 

I have access on ArcGIS online as a publisher!  I am trying to run the codes, but breaks after I enter my AGOL credentials.

I changed my images file path, but doesn't work. 

Where are these paths ? 

         uploadPartURL ='{}.maps.arcgis.com/sharing/rest/content/users/{}/addItem'.format(portalUrl, user) 

         shareurl = '{}.maps.arcgis.com/sharing/rest/content/users/{}/shareItems'.format(portalUrl, user)

Are these paths from online content? 

Any help would be appreciated!

Thanks,

Jules.

0 Kudos
KellyGerrow
Esri Frequent Contributor

What is the error message that you are receiving?

What version of Python are you running his in? Be aware that this is written in an older version (2X)

-Kelly

0 Kudos
JulesKarasira
New Contributor II

Thank you Kelly,

I think I was using a wrong version! It is running amazing. 

Jules.

0 Kudos