One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
mickedg
8 years agoHelpful | Level 6
swifty dropbox route error incorrect offset
Hi - I'm using Swifty Dropbox to upload individual files to another dropbox using
let dbClient = DropboxClient(accessToken: "xxxxx....."
and the methods
func doUpload(fileName: String) func uploadFirstChunk() func uploadNextChunk()
In this part:
dbClient.files.uploadSessionAppendV2(cursor: Files.UploadSessionCursor(sessionId: self.sessionId, offset: UInt64(offset)), input: data!) .response { response, error in if error == nil { self.offset += self.chunkSize self.uploadProgress = Double(self.offset)/Double(self.videoFileSize) self.progressView.progress = Float(self.uploadProgress) self.uploadNextChunk() } else if let callError = error {
I' ve seen Route Error/IncorrectOffset: {"correct_offset" = 1048576;}.
A beta tester has also reported it. It's not consistent, I only get it occasionally.
What does it mean?
- mickedgHelpful | Level 6
I found this explanation for the Incorrect Offset error: "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."
Is there anything I can do if this error is very frquent?- Greg-DB
Dropbox Staff
That's the correct documentation for this error. It generally shouldn't happen often, but if it does, it may indicate an issue with your upload session logic that you should debug.
When you do get it though, you can have your app continue with the upload session, but pick it up from the specified correct offset. For example, in this case the API indicated that it received data up to offset 1048576 so far, so your app should continue the upload session by uploading further portions of data starting at offset 1048576.- mickedgHelpful | Level 6
Thanks Greg! I've lowered the chunk size to 1 MB, could that be the problem? I wanted to do that in order to get a smoother progress view. The files that I'm uploading are typically around 100 - 200 MB. What would be the optimal chunk size from a performance perspective?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.5,950 PostsLatest Activity: 8 hours ago
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!