Learn how to make the most out of the Dropbox Community here 💙.
Learn how to make the most out of the Dropbox Community here 💙.
Hi MatthiD
You can definitely just start an upload session and then finish it, without needing to use `filesUploadSessionAppendV2`.
Looking at the code snippet provided, it looks like you are starting an upload session by calling `filesUploadSessionStart()`, but are attempting to finish that same session by calling `filesUploadSessionFinishBatchV2()`. While this technically does work — `filesUploadSessionFinishBatchV2()` will finish an upload session started with `filesUploadSessionStart()` — you may want to use one of the following combinations:
Keep in mind that `filesUploadSessionStart()` is meant to upload a single file, whereas `filesUploadSessionStartBatch()` starts a batch of upload sessions.
Additionally, since there is no functionality to separate the files, please ensure you are not combining all of the file data of multiple files into one large buffer — use one upload session per file needing to be uploaded.
To answer your additional questions:
Lastly, the error you are receiving means:
The specified offset was incorrect. See the value for the correct offset. This error may occur when a previous request was received and processed successfully but the client did not receive the response, e.g. due to a network error.
The "correct_offset" value from the response you provided means that the Dropbox API had only received 257523 bytes for the upload session so far. The error "incorrect_offset" was thrown because the Dropbox API received a value other than 257523 in your request.
Feel free to take a look at this example for an idea of how an upload session can be handled.
For best practices when uploading files via the Dropbox API, please refer to our Performance Guide.
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!