Retrieving a File from the Device

The device manager provides a method to upload a file from the device into either the global or thing file storage in Device Cloud.

In this procedure, the thing key of the device manager is as follows, where deviceId is the value in the device_id file in the configuration directory:

Python Agent

deviceId-device_manager_py

C Agent

deviceId-device-manager

You need your user name, password, and URL for Device Cloud.

The device manager on the device must be connected to Device Cloud.

The device manager must have permission to read the directory and file on the device.

If you run the Python agent and want to upload all the files in the directory, you must specify true (the default) for the upload_tar_file attribute in the iot.cfg file.

  1. In your browser's address bar, type the URL you were given when you received your Device Cloud account, and then on the Sign In page, type your user name and password in the boxes.
  2. On the LaunchPad, click Development Tools.
  3. On the Management Portal, click Things, and then click the View icon of the device manager thing.
  4. On the thing details page, select the Methods tab, and then click Retrieve Files.
  5. (Optional) In the file_name box in the Retrieve Files window, type the name of the file you want to use.

    You can use a different file name from the name of the file you are retrieving.

    If you do not specify a value, the file name from the device is used.

  6. In the file_path box, type the directory and file name of the file on the device.

    You can specify a path as follows:

    • Python agent: relative to the runtime_dir/upload, where runtime_dir is the value of the runtime_dir attribute specified in the iot.cfg file

    • C agent: relative to /var/lib/iot/upload directory

    • the full path

    If you want to upload all files in a directory, specify the directory name.

  7. To upload the file to the global file store, select the use_global_store check box.
  8. Click Execute.

    The Output box shows "" (double quotes) to indicate that the file uploaded successfully from the device with the file name you specified.

    If the file already exists in the file store you specified, the file is overwritten.

    If you specified a directory to upload, the files are uploaded in a tar.gz file.

You can download the file to your computer from the thing details page under the Files tab or the Files page if you selected use_global_store.