Skip to content

Instantly share code, notes, and snippets.

@otkrsk
Last active February 20, 2020 01:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save otkrsk/ee574feb5c4075293c67cf4d29e680a3 to your computer and use it in GitHub Desktop.
Save otkrsk/ee574feb5c4075293c67cf4d29e680a3 to your computer and use it in GitHub Desktop.
Get a list of files in a directory and execute a curl command to upload the files to Dropbox
for file in "."/*
do
curl -X POST https://content.dropboxapi.com/2/files/upload --header "Authorization: Bearer <token>" \
--header "Dropbox-API-Arg: {\"path\": \"/folder1/folder2/${file:2}\",\"mode\": \"add\",\"autorename\": true,\"mute\": false}" \
--header "Content-Type: application/octet-stream" \
--data-binary @${file:2}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment