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
    }
  }
}

Response Parameters

Name Type Description
fileId String A unique file handle id to be used in the HTTP GET.
fileSize Integer Size of the requested file in bytes.
crc32 Integer A IEEE CRC32 checksum of the file that has been uploaded.

Related Topics Link IconRelated Topics