Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
0ylanmorisson
9 years agoExplorer | Level 3
Issues about Chunkupload
I'm writing a very simple console uploading program using most of the sample code from Dropbox.net Api. But I have two issues now.
When the network drops and reconnects, I get an error saying "...
- 9 years ago
The documentation for UploadSessionLookupError.IncorrectOffset covers an example of how this can occur:
"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."
To get the correct offset, you can catch and inspect the exception like this:
try { await client.Files.UploadSessionAppendV2Async(cursor, body: memStream); } catch (ApiException<UploadSessionLookupError> e) { if (e.ErrorResponse.IsIncorrectOffset) { Console.WriteLine("Expected offset: " + e.ErrorResponse.AsIncorrectOffset.Value.CorrectOffset); } // todo: other error handling throw; }In your 5120kb file scenario, I believe the offset would still be 3072 at that point, since the connection failed. However that may depend on the exact nature of the failure, so you should always check the returned value anyway.
Greg-DB
Dropbox Community Moderator
9 years agoIt sounds like you already have the right idea, in that you should store upload session ID and resume the upload from where you left off. I don't recommend relying on the session ID having "AAAA" though, as that's not guaranteed. You should store it in some format you can rely on, and use whatever session ID string the API gave you.
As far as how you interact with the local file, I'm afraid that's a bit outside the scope of Dropbox API support, as that has to do with the local file system and not Dropbox. You'll probably want to refer to the documentation for FileStream and MemoryStream to determine how to start reading from the file at a particular offset in the file.
As far as how you interact with the local file, I'm afraid that's a bit outside the scope of Dropbox API support, as that has to do with the local file system and not Dropbox. You'll probably want to refer to the documentation for FileStream and MemoryStream to determine how to start reading from the file at a particular offset in the file.
0ylanmorisson
9 years agoExplorer | Level 3
Alright. Thank you!
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!