URI
<myData_uri>/upload[.<format>]
Supported methods
Parent resource
Introduction
The fileUpload resource is used to upload data file specified by data item id.
Supported Methods:
- POST: Upload data file specified by data item id. See POST Request on myDatas Resource for data item id acquisition.
Supported output formats: RJSON, JSON, HTML, XML.
Resource hierarchy
HTTP request methods
Implement the HTTP request on the following URI, where supermapiportal is the server name, with rjson being the output format.
http://supermapiportal:8190/iportal/web/mycontent/datas/{id}/upload.rjson
POST request
Upload data file specified by data item id. The request body is text stream.
Request parameter
When sending the request, the following parameters need to be passed in the request body:
| Field | Type | Description |
| xIndex | int | [Optional] When uploading Excel and CSV data, the index of the column corresponding to the X coordinate. |
| yIndex | int | [Optional] When uploading Excel and CSV data, the index of the column corresponding to the Y coordinate. |
| fieldTypes | String[] | [Optional] The field types in the uploaded Excel data. |
| separator | String | [Optional] The delimiter of the CSV file when uploading CSV data. |
Response structure
When you implement the POST request on the fileUpload resource to upload data file specified by data item id, the structure of the returned resource is as follows:
| Field | Type | Description |
|
childID |
String | The id of child resource, that is, data item id. |
|
childContent |
Object |
The content of the child resource. |
|
childUrl |
String |
The URI of the child resource. |
|
customResult |
Object |
Custom result. |
|
isAsynchronizedReturn |
boolean |
Whether to return result asynchronously. The value for isAsynchronizedReturn of this resource is always false. |
Response example
Implement the POST request on the fileUpload resource http://localhost:8190/iportal/web/mycontent/datas/1/upload.rjson to return the result in rjson format:
{
"childContent": null,
"childID": "1",
"childUrl": null,
"customResult": null,
"isAsynchronizedReturn": false
}