We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
Priya M.
8 years agoExplorer | Level 4
Dropbox API to create a file, write in it via stream and then close the file.
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?
- Greg-DBDropbox Staff
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-curl-in-php#t=20170419174709470892
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.- Priya M.Explorer | Level 4Hi,
Thank you for your response.
But this would require uploading the file in one go whereas I want to upload a file in chunks, say, the file size is 500 MB but I want to upload it 100 MB at a time and next continue writing the next 100 MB from the place it left and so on. At the end we want to close the file- Greg-DBDropbox StaffFor large files, or any files you want to upload in pieces, you should use upload sessions:
https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-start
https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-append_v2
https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-finish
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 12 months agoIf 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!