addItemResource

addItemResource

Function
addItemResource(requestOptionsIItemResourceOptions): Promise<IItemResourceResponse>

Add a resource associated with an item. See the REST Documentation for more information.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { addItemResource } from "@esri/arcgis-rest-portal";

// Add a file resource
addItemResource({
  id: '3ef',
  resource: file,
  name: 'bigkahuna.jpg',
  authentication
})
  .then(response)

// Add a text resource
addItemResource({
  id: '4fg',
  content: "Text content",
  name: 'bigkahuna.txt',
  authentication
})
  .then(response)
Parameters
ParameterTypeNotes
requestOptions
IItemResourceOptions

Options for the request

Returns 
Promise<IItemResourceResponse>

A Promise to add item resources.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.