We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

0ylanmorisson's avatar
0ylanmorisson
Explorer | Level 3
8 years ago

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 "...
  • Greg-DB's avatar
    8 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.

     

     

     

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 12 months ago
326 Following

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!