cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Uploading multiple files at once with thier names

Uploading multiple files at once with thier names

H0ba
Explorer | Level 3

I have this code to upload a simple file

curl -k -X POST https://content.dropboxapi.com/2/files/alpha/upload \
--header 'Authorization: Bearer <ACCESS_TOKEN_REDACTED> \
--header 'Content-Type: application/octet-stream' \
--header 'Dropbox-API-Arg: {"path":"/Apps","mode":{".tag":"add"}}' \
--data-binary @test.sav


But the file get renamed to Apps

Also I want to upload all .sav files inside my folder like *.sav or something
While keeping thier original names
And thanks

1 Reply 1

Greg-DB
Dropbox Staff

When making an API call like this, the 'path' value you supply should be the file path and name where you want to upload the file. In your case, you're just supplying "/Apps", so that's what the file will be saved as. You should instead supply something like "/myfolder/originalfilename.sav". That is, include the name and extension. (Note that if your app has the "app folder" permission, you don't need to explicitly include "/Apps". That portion will be automatically added for you.)

 

By the way, you posted your access token publicly. I redacted it from your post for you, but for the sake of security, you should disable that access token. You can do so by revoking access to the app entirely, if the access token is for your account, here:

 

https://www.dropbox.com/account/security

 

Or, you can disable just this access token using the API:

 

https://www.dropbox.com/developers/documentation/http/documentation#auth-token-revoke

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?