Update Resources

Description

The update resources operation (POST only) allows to update existing file resources of an item. File resources use storage space from your quota and are scanned for viruses. The item size is updated to include the size of updated resource files. A maximum of 50 files can be updated each request. Each file should be no more than 10 Mb.

Supported file formats are: JSON, XML, TXT, PNG, JPEG, GIF, BMP, PDF, and ZIP.

File resources must be uploaded in an HTTP multi-part request pursuant to IETF RFC1867.

The operation is only available to the item owner and the organization administrator.

Request Parameters

Parameter

Details

[Common Parameters]

For a complete listing, see Common parameters.

file

Multi-part HTTP parameter containing the binary file to upload.

resourcesPrefix

(Optional) Folder name used as a prefix of existing file resources to be updated. Resources prefix has to match that of the existing file resources in order to update successfully.

The updated file resources can be accessed either by http://<item-url>/resources/<resourcesPrefix>/<resourcename> or http://<useritem-url>/resources/<resourcesPrefix>/<resourcename>.

fileName

(Optional) File name used to rename one uploaded file or used together withtext input to match existing item resource name.

For example, you can use fileName=banner.png to update an existing resource banner.png with a file called billboard.png without renaming the file locally.

text

(Optional) Text input to update an existing text resource, used together with fileName.

Response Properties

Property

Details

success

Indicates if the operation was successful.

itemId

The ID of the item that file resources were added to.

owner

The owner of the item.

folder

The ID of the folder where the item is, null if the item is in the root folder.

Example Usage

URL for Update Resources

http://www.arcgis.com/sharing/rest/content/users/jsmith/items/0c66beb52dff4994be67937cdadbdb1f/updateResources

JSON Response Syntax

{
  "success": true,
  "itemId": "<item id>",
  "owner": "<owner username>",
  "folder": "<folder id>"
}

JSON Response Example

{
  "success": true,
  "itemId": "0c66beb52dff4994be67937cdadbdb1f",
  "owner": "jsmith",
  "folder": null
}

or

{"error": {
 "code": 404,
 "message": "Resource does not exist or is inaccessible.",
 "details": []
}}

3/3/2017