Last active
February 20, 2020 01:15
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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