unixslayer
unixslayer

Reputation: 28

Overlapping ranges error when sending larger file

I'm trying to upload ~47M file with 4M chunks through https://developer.api.autodesk.com/oss/v2/buckets/:bucketKey/objects/:objectName/resumable but keep getting 416 with "Overlapping Ranges" error.

Chunks are send with Content-Range header as follow:

"bytes: 0-4194303/47992832"
"bytes: 4194304-8388607/47992832"
"bytes: 8388608-12582911/47992832"
"bytes: 12582912-16777215/47992832"
"bytes: 16777216-20971519/47992832"
"bytes: 20971520-25165823/47992832"
"bytes: 25165824-29360127/47992832"
"bytes: 29360128-33554431/47992832"
"bytes: 33554432-37748735/47992832"
"bytes: 37748736-41943039/47992832"
"bytes: 41943040-46137343/47992832"
"bytes: 46137344-47992831/47992832"

For each chunk Content-Length is 4194304 but last one which is 1855488. Seems to me that Requests are correct and I don't know where to look on my side.

Upvotes: 0

Views: 48

Answers (1)

cyrille
cyrille

Reputation: 2659

The ranges provided look ok to me, but this API requires a 'Session-Id' in the request header. That 'Session-Id' should be the same for every requests to upload a file in chunk. But must be different each time. If you are using the same 'Session-Id' to upload files (or the same file), you'll get that error, because a range will be recorded twice or overlap with a previous call. In short generate a new 'Session-Id' each time you start that process.

Upvotes: 1

Related Questions