file.get
The file.get command reserves a file handle for a given file to be obtained via HTTP GET. To learn more about how files are used in the deviceWISE Cloud, see Understanding files.
By default all files are downloaded using chunked encoding. If you want to disable chunked encoding, edit the File handling and this setting will be applied organization wide. For more information on editing the File handling, see Editing File handling
TR50 Request
{
"cmd": {
"command": "file.get",
"params": {
"fileName": "myname.txt",
"thingKey": "myThing"
}
}
}
Request Parameters
When you upload a large file to the deviceWISE Cloud, the file gets divided into smaller chuncks by the deviceWISE Cloud. If you try to download or delete a file that is being uploaded in chunk, you will get a File <filename> not found error.
Name | Type | Required | Description |
---|---|---|---|
thingKey | String | The Thing associated with the file. Defaults to the current session's Thing. | |
global | Boolean | If set to true, the file is a global file and the thingKey parameter will be ignored. | |
fileName | String | Yes | The name of the file to be retrieved from the deviceWISE Cloud. |
TR50 Response
If the command is sent successfully a success message and params list is returned. Otherwise, an error and error message will be returned.
{
"cmd": {
"success": true,
"params": {
"fileId": "50000000000000000000042",
"fileSize": 42,
"crc32": 1239918451
}
}
}