In Chunk upload it is showing error like "request_size_too_long".
I am trying to upload the 37mb file using chunk upload.
1. I created the upload session.
Body:
{
"folder_id": "0",
"file_size": 38273024,
"file_name": "37mb"
}
Response:
{
"total_parts": 5,
"part_size": 8388608,
"session_endpoints": {
"list_parts": "https://upload.box.com/api/2.0/files/upload_sessions/FB2E73F5F631797D3E2F127170D327D8/parts",
"commit": "https://upload.box.com/api/2.0/files/upload_sessions/FB2E73F5F631797D3E2F127170D327D8/commit",
"log_event": "https://upload.box.com/api/2.0/files/upload_sessions/FB2E73F5F631797D3E2F127170D327D8/log",
"upload_part": "https://upload.box.com/api/2.0/files/upload_sessions/FB2E73F5F631797D3E2F127170D327D8",
},
"session_expires_at": "2024-06-03T12:00:00Z",
"id": "FB2E73F5F631797D3E2F127170D327D8",
"type": "upload_session",
"num_parts_processed": 0
}
2)Upload part of file.
curl -X PUT https://{{upload.box.com}}/api/2.0/files/upload_sessions/:upload_session_id\
-H "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXX" \
-H "Digest: sha=sha=fpRyg5eVQletdZqEKaFlqwBXJzM=" \
-H "Content-Range: bytes 8388608-16777215/38273024" \
-H "Content-Type: application/octet-stream" \
--data-binary @37mb.zip
-H "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXX" \
-H "Digest: sha=sha=fpRyg5eVQletdZqEKaFlqwBXJzM=" \
-H "Content-Range: bytes 8388608-16777215/38273024" \
-H "Content-Type: application/octet-stream" \
--data-binary @37mb.zip
Response:
{
"code": "request_size_too_long",
"message": "Request body larger than expected number of bytes: 8388608",
"request_id": "693372e8536c3338b3c36275b3037e00"
}
Can any one say what range of bytes i should give in content Range. And also say how to extract the digest. To rectify this error.
Please sign in to leave a comment.
Comments
0 comments