Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hello,
My scenario:
In the application I am working I have to upload chunk of file data and append to a file in dropbox. In the application I will not know the source file name. All I get, through a method call is a ByteBuffer and name of the file on DropBox. I need to upload this chunk of data. The method could be called a number of times depending on file size. For example:
public boolean write (ByteBuffer buf, String drpbxFileName) {
// Need to upload the data in buf to a file in dropbox.
}
Any suggestions on how I can achieve this? I use Java.
I thought of using uploadSessionStart and uploadSessionAppendV2 methods for writing the first chunk. But I don't seem to get how I can pass data to uploadSessionAppendV2 method when the next chunk of file data comes with next call to write method.
Thanks
If you're using Java, we do recommend using the official Dropbox API v2 Java SDK. There's an example of uploading files included, for both uploading small files, as well as uploading larger files using upload sessions.
To clarify though, do you need to append data to an existing uploaded file? Note that you can append to an upload session by calling uploadSessionAppendV2 as many times as you need, but you need to upload the entire file each time you want to update it. That is, each "upload session" is a way to update a single file to a whole new version of that file, but uploading all of the data for that file version.
Thank you for the reply.
Yes, I need to append data to an existing file on Dropbox. Uploading entire file each time is not an option for me because the data to be appended comes in as an input to my method. So all I have is a byte array which needs to be appended to a file on Dropbox.
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!