file.get

The file.get command reserves a file handle for a given file to be obtained through HTTP GET.

TR50 Request


                        {
  "cmd": {
    "command": "file.get",
    "params": {
      "fileName": "myname.txt",
      "thingKey": "myThing"
    }
  }
}
      

Request Parameters

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

The fileId returned from file.get is only valid for a single use and times out within 300 seconds by default.

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.