You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

H0ba's avatar
H0ba
Explorer | Level 3
8 years ago

Uploading multiple files at once with thier names

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

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox 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

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,910 PostsLatest Activity: 3 days ago
333 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!