POST /files
This resource works like an explorer. You can go through the files and folders in the device. You can read, add, or remove a file/folder.
This resource performs multiple actions:
To create a folder, you need to add the folder path to the URL, and the last path component will be the name of the new folder.
Example:
/files/folder1/folder2/myNewFolder
To create a file, ensure your POST is a multipart/form-data request.
Please refer to the the Documentation section to find out how to create a Multipart.
You can also refer to the example below.
It is possible to add multiple files at the same time with the Multipart syntax. If the request succeeds, you will receive a 207 Multi-Status response with a body that represents the action (create, update), the new file path and the status.
This step is the summation of the folder creation and file creation process.
The new folder destination is located in the URL, and the file is in the body.
If one file has been created on the device as a result of successfully processing a POST request, the origin server will send a 201 Created response status containing a Location header field that provides an identifier for the primary resource created.
If this parameter is not in the request, the Application/Json will be chosen by default. JSON and XML are the most commonly used values. There are multiple possible values (according the resource):
Located in : Header
Example values : accept:application/json
There are multiple possible values according the resource:
If this parameter is not present during the request, and error 415 Unsupported Media Type will be thrown.
Located in : Header
Example values : content-type:application/json
The Content-Length entity-header field indicates the size of the entity-body.
Located in : Header
Example values : content-length:526
URL Example: https://0.0.0.0/api/rest/v1/files/folderTest
---------------------------acebdf13572468
Content-Disposition: form-data; name="fieldNameHere"; filename="credits.txt"
Content-Type: text/plain
The file content is here...
---------------------------acebdf13572468--