Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hi,
I am from Softaculous Ltd. I already have an open issue but here I'm opening a new one which is regarding a different issue.
I have a query regarding Dropbox. We want our users to upload their backups (which will be .tar.gz file) on Dropbox. Now what we want is that we can create an empty file on Dropbox, add the content to it via stream (as in we can do via FTP using ftp:// stream) and then close the file.
I'm not able to find the related APIs. Can you please tell me about it?
To upload a file using the API, you can use the /2/files/upload endpoint:
https://www.dropbox.com/developers/documentation/http/documentation#files-upload
That is a "Content-upload" style endpoint, so it expects the file contents in the request body, as documented in the "Request and response formats" section:
https://www.dropbox.com/developers/documentation/http/documentation#formats
There's an example of uploading from PHP using curl here:
https://stackoverflow.com/documentation/dropbox-api/409/uploading-a-file/1354/uploading-a-file-via-c...
Exactly how you access the data on your local client is up to you. The API just requires that you pass up all of the file data in the request body.
Hi,
Thank you for your response.
I'll implement these and get back to you if I face any issues.
Hi,
I have some doubt about 'files_upload_session_start' API. Do I require to first call the 'upload' API and then start the 'upload_session_start' API as I can't see where to mention the dropbox path where I want to upload the file to in 'upload_session_start' API. Can you please tell me how to implement this?
Also if I want to upload 1MB at a time instead of 150 MB, how can I mention that?
Hi,
While using 'appen_v2' API, there is a parameter 'offset' which is the amount of data that has been uploaded so far. From where do we get the amount of data uploaded so far? Do we have to calculate on our own? As I can't see any amount of data uploaded returned by the 'file_upload_session_start' parameter.
Hi,
Can I get a faster response on this?
No, you don't need to also call /upload if you're using upload sessions. You specify the path where you want to upload the file when you call /2/files/upload_session/finish.
If you want to upload 1 MB at a time, you would just supply 1 MB of data to each request to /2/files/upload_session/start, /2/files/upload_session/append_v2, and /2/files/upload_session/finish. That is, you would have your app only submit 1 MB of data (in the request body) per call.
When calling /2/files/upload_session/append_v2 or /2/files/upload_session/finish, the 'offset' is the total amount of data that has been uploaded so far for that upload session, in bytes. This is something the app should keep track of client-side, as the app decides how much to upload each time.
There's a basic example of using upload sessions that may be helpful here. It's for the Python SDK, but the logic is the same.
Hi there!
If you need more help you can view your support options (expected response time for a 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!