Learn R Programming

rdrop2 (version 0.8.2.1)

drop_share: Creates and returns a shared link to a file or folder.

Description

Creates and returns a shared link to a file or folder.

Usage

drop_share(
  path = NULL,
  requested_visibility = "public",
  link_password = NULL,
  expires = NULL,
  dtoken = get_dropbox_token()
)

Arguments

path

Path in the user's Dropbox, relative to root

requested_visibility

Can be `public`, `team_only`, or `password`. If the password option is chosen one must specify the `link_password`. Note that for basic (i.e. free) Dropbox accounts, the only option is to publicly share. Private sharing requires a pro account.

link_password

The password needed to access the document if `request_visibility` is set to password.

expires

Set the expiry time. The timestamp format is "%Y-%m-%dT%H:%M:%SZ"). If no timestamp is specified, link never expires

dtoken

The Dropbox token generated by drop_auth. rdrop2 will try to automatically locate your local credential cache and use them. However, if the credentials are not found, the function will initiate a new authentication request. You can override this in drop_auth by pointing to a different location where your credentials are stored.

References

API documentation

Examples

Run this code
# NOT RUN {
write.csv(mtcars, file = "mt.csv")
drop_upload("mt.csv")
drop_share("mt.csv")
# If you have a pro account, you can share files privately
drop_share("mt.csv", requested_visibility = "password", link_password = "test")
# }

Run the code above in your browser using DataLab