We're making changes to the Community, so you may have received some notifications - thanks for your patience and welcome back. Learn more here.
Forum Discussion
RTS S.
9 years agoHelpful | Level 6
Java API V2 Session Upload
Can you post a simple example showing how to use:
uploadSessionStart uploadSessionAppendBuilder uploadSessionFinishBuilder Including intermediate steps ... I am stuck on how to get a Sess...
Kannan G.1
9 years agoDropbox Staff
This API is kind of a mess right now. We need to sort some things out to make it clearer, but for now, this might work:
```
DbxClientV2 client = ...
uploader = client.files.uploadSessionStart();
String sessionId;
try {
uploader.getBody().write(first_chunk_of_upload)
sessionId = uploader.finish()
} finally {
uploader.close()
}
uploader = client.files.uploadSessionAppend(sessionId, offset)
try {
uploader.getBody().write(second_chunk_of_upload)
uploader.finish()
} finally {
uploader.close()
}
cursor = UploadSessionCursor(sessionId, offset);
FileMetadata md = client.files.uploadSessionFinishBuilder(cursor, ...).run(third_chunk_of_upload);
```
I don't have time to test the code right now. Lemme know if you run into any issues and I'll take a closer look.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,875 PostsLatest Activity: 3 hours 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!