2.2.3. DownloadFile

Implement this function:

User.download_file(filename: str) bytes

Downloads the contents of the latest version of the file named filename that is owned by the calling user, and returns its contents. However, raises a util.DropboxError in the following circumstances:

  • If no file named filename exists.

  • The integrity of the file cannot be verified (i.e. due to malicious action).

  • File retrieval cannot complete due to malicious action.

Parameters:

filename (str) – The name of the file

Returns:

The file data

Return type:

bytes

Raises:

DropboxError – if an error case occurred