"Dropbox" (Service Connection)

Connect your Dropbox account to the Wolfram Language to read and write files in your Dropbox file directory.

Connecting & Authenticating

ServiceConnect["Dropbox"] creates a connection to the Dropbox API. If a previously saved connection can be found, it will be used; otherwise, a new authentication request will be launched.

Requests

ServiceExecute["Dropbox","request",params] sends a request to the Dropbox API, using parameters params. The following give possible requests.

User Data

Requests:

"UserData" data about the authenticated user's account

Search

Requests:

"FileSearch" search file names within a directory

Parameters:
  • "Query"(required)query string
    "Path""/"directory to search
  • Uploading

    "Upload" add or update the contents of a file

    "Put" put a Wolfram Language expression in a file

    Parameters:
  • "File"(required for Upload)file path or File[...]
    "Expression"(required for Put)Wolfram Language expression
    "Path"(required)path in dropbox account
    "Mode""Add"write mode ("Add", "Overwrite" or "Update")
    "Autorename"Truerename if there is a name conflict
  • Downloading

    "Download" download a file

    "Get" get a Wolfram Language expression from a file

    "FileContents" get the raw contents of a file as a byte array

    Parameters:
  • "Path"(required)path in dropbox account
    "Destination"$TemporaryDirectorypath to download the file
  • Files and Directories

    "FileNames" list the files in a directory

    "FileData" file metadata

    "DirectoryData" directory metadata

    "DeleteFile" delete a file

    "CreateDirectory" create a directory

    "DeleteDirectory" delete a directory

    Parameters:
  • "Path"(required)path in dropbox account
    "Recursive"Falsewhether to recursively list files in a directory
  • Examples

    Basic Examples  (1)

    Create a new connection by launching an authentication dialog:

    Store the plot as an image:

    Verify that the file exists:

    Retrieve the metadata for the file:

    Get the plot from a file:

    Store an expression:

    Retrieve the file:

    The expression is returned as it is:

    Store a file:

    Retrieve the file and save it to the temporary folder: