Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
RomanRGS
8 years agoExplorer | Level 3
Hello, i get error after upload 4Gb data with .Net 4.5 UploadSessionAppendV2Async()
Hello, i get error after upload 4Gb data with .Net 4.5 UploadSessionAppendV2Async() in Dropbox.Api.Files.UploadSessionLookupError: incorrect_offset in DropBox.Api.DropBoxRequestHandler.d__d`3.MoveNext...
- 8 years agoThanks! It looks like you're using a sample we originally posted on the forum here. Thanks to your post, we found an issue with it that would cause it to fail for very large files, due to the use of smaller int types. We've posted an updated version that uses bigger types here:
https://stackoverflow.com/documentation/dropbox-api/409/uploading-a-file/1358/uploading-a-file-using-the-dropbox-net-library#t=201705231652364198429
The use of longs instead of ints lets it support very large offsets.
Greg-DB
Dropbox Community Moderator
8 years agoCan you share the code you're using that reproduces this issue? Thanks in advance!
- RomanRGS8 years agoExplorer | Level 3
This code get error on method UploadSessionAppendV2Async after 4gb upload.
static async Task ChunkUpload(DropboxClient client, String path, FileStream stream, int chunkSize) { int numChunks = (int)Math.Ceiling((double)stream.Length / chunkSize); byte[] buffer = new byte[chunkSize]; string sessionId = ""; for (int idx = 0; idx < numChunks; idx++) { int bytesRead = stream.Read(buffer, 0, chunkSize); using (var memStream = new MemoryStream(buffer, 0, bytesRead)) { if (idx == 0) { var result = await client.Files.UploadSessionStartAsync(false, memStream); sessionId = result.SessionId; } else { var cursor = new UploadSessionCursor(sessionId, (ulong)((uint)chunkSize * (uint)idx)); if (idx == numChunks - 1) { FileMetadata fileMetadata = await client.Files.UploadSessionFinishAsync(cursor, new CommitInfo(path), memStream); } else { await client.Files.UploadSessionAppendV2Async(cursor, false, memStream); } } } } }- Greg-DB8 years ago
Dropbox Community Moderator
Thanks! It looks like you're using a sample we originally posted on the forum here. Thanks to your post, we found an issue with it that would cause it to fail for very large files, due to the use of smaller int types. We've posted an updated version that uses bigger types here:
https://stackoverflow.com/documentation/dropbox-api/409/uploading-a-file/1358/uploading-a-file-using-the-dropbox-net-library#t=201705231652364198429
The use of longs instead of ints lets it support very large offsets.- RomanRGS8 years agoExplorer | Level 3
works fine, thanks.
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!