cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Resume upload: what is the current offset?

Resume upload: what is the current offset?

josuegomes
Helpful | Level 6

Hi,

 

I understand I can use upload sessions to upload large files. That is: call Upload Session Start, then Upload Session Append and finally Upload Session Finish.

My question: is it possible to query what is the current offset taking only the session id?

 

The scenario is: application calls Upload Session Start, saves (persists) the session id, calls several times Upload Session Append.

Then the application exits (either by user request or by a failure).

The application starts again, takes the saved session id and tries to continue the upload (with Upload Session Append).

However it seems there is no way to query what is the current offset.

 

Possible solutions are: persist the current offset together with the serssion id.

Or call Append with an invalid offset (eg 0), it returns the `UploadSessionOffsetError` error with the correct offset.

 

Is it ok to rely on the UploadSessionOffsetError?

 

 

2 Replies 2

Здравко
Legendary | Level 20

@josuegomes wrote:

...

Possible solutions are: persist the current offset together with the serssion id.

Or call Append with an invalid offset (eg 0), it returns the `UploadSessionOffsetError` error with the correct offset.

 

Is it ok to rely on the UploadSessionOffsetError?


Hi @josuegomes,

Yes, that's are the possible ways. Is it Ok or Not - it's your design decision; it would work. I personally prefer the first option (to save current state - both id and offset or set of offsets/pattern when concurrent upload is in use).

Good luck.

Greg-DB
Dropbox Staff

@josuegomes Yes, as Здравко said, either way would work. In general though the expectation is that the app would record the current offset locally.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?