Retrieving a File from Device Cloud in Python
A client application can retrieve a file from the global file storage or the file storage of a thing in Device Cloud and store it in any device location to which it has write access.
As part of the file transfer function call, the application can specify optional parameters as follows:
-
a callback function to call after the file transfer completes successfully to perform any post-processing
-
whether to wait for the file transfer to finish and how long to wait, in seconds (by default, the application does not block and the timeout is zero)
To retrieve files, the application must be connected to Device Cloud.
The application must have write access to the specified directory.
The file must exist in the Device Cloud file storage from which you want to retrieve it.
When the application calls the function, the file is retrieved from the storage location in Device Cloud as specified in the file_global parameter and stored in the specified directory on the device. If the file already exists, it is overwritten.