Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

autodesk forge - 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.

question from:https://stackoverflow.com/questions/65950776/overlapping-ranges-error-when-sending-larger-file

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...