Select to view content in your preferred language

Is it possible to upload a file directly to an ArcGIS Online folder?

960
2
Jump to solution
11-12-2021 10:44 AM
ewagstaff
Occasional Contributor

Hi all, I'm using the REST API and trying to upload GeoJSON files to a specific folder (called "uploads"). I'm following the addItem documentation here and it is working to upload items to my account, however the uploads just appear as miscellaneous items in my content directory rather than in the upload folder. 

The documentation seems to suggest there should be a way to specify a target folder for addItem:

 

"The Add Item operation (POST only) is used to upload an item file, submit text content, or submit the item URL to the specified user folder depending on documented items and item types. This operation is available only to the specified user."

 

 

However there is no listed argument to set the target folder. I have tried a few guesses, like "folder", but nothing has worked so far. Is there a best practice on how to do this?

The response from addItem gives me hope that it's possible:

{
  "success": true,
  "id": "950de34a8a7c42ecb937cc3f8570db67",
  "folder": null
}

 

With the right argument, I would hope the "folder" property would have the folder's ID listed instead of null.

0 Kudos
1 Solution

Accepted Solutions
AdminGIS2
Occasional Contributor

You can accomplish this by adding the folder ID to the request url as such:

https://[root]/content/users/[userName]/[folderID]/addItem

 

View solution in original post

2 Replies
AdminGIS2
Occasional Contributor

You can accomplish this by adding the folder ID to the request url as such:

https://[root]/content/users/[userName]/[folderID]/addItem

 

ewagstaff
Occasional Contributor

THANK YOU! That is the answer. Much appreciated!

0 Kudos