Reputation: 1
I'm using OneDrive chunked upload for a file of 80MB, with a chunk size of 50MB.
All chunks except the last one are successfully uploaded. The last chunk always returns HTTP 416 (Range Not Satisfiable). The nextExpectedRanges matches my Content-Range exactly. The upload session is still active. Steps Taken & Debugging So Far:
Checked nextExpectedRanges from OneDrive's response before sending the last chunk. ✅
Verified Content-Range calculation to ensure the last byte is correct (bytes start-end/total). ✅
Confirmed InputStream is positioned correctly before reading the last chunk. ✅
Ensured only the expected bytes are being read and sent (no extra/missing bytes). ✅
Checked that previous chunks were fully received before uploading the last one. ✅
Session is active (expirationDateTime is in the future). ✅
Example of My Last Chunk Request: css Copy Edit
Content-Range: bytes 52428800-81539536/81539537 (nextExpectedRanges also returns "52428800-81539536" before this request.)
Despite everything matching, the last chunk still fails with HTTP 416.
Question: What could be causing OneDrive to reject only the last chunk? Are there any additional conditions for the final chunk in a chunked upload?
Upvotes: 0
Views: 13