Invalid value 81 for parameter type during chunked upload
Hello all,
I am implementing a chunked video upload through the direct HTTP endpoints, using resumablejs & following the instructions on in your doc & support forums
https://cloudinary.com/documentation/upload_images#chunked_asset_upload
However, I am unable to get the chunked upload working. The first N-1 chunks are accepted and the response I am getting looks OK
curl 'http://api.cloudinary.com/v1_1/primer-cloudinary/upload' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:76.0) Gecko/20100101 Firefox/76.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Content-Range: bytes 0-6291455/16856005' -H 'X-Unique-Upload-Id: 2020-05-31T21:42:35.619Z-17mb.mov' -H 'Content-Type: multipart/form-data; boundary=---------------------------105160898611832095003078998430' -H 'Origin: http://localhost:3000' -H 'Connection: keep-alive' -H 'Referer: http://localhost:3000/username/project/teaching-about-animals' --data-binary $'-----------------------------105160898611832095003078998430\r\nContent-Disposition: form-data; name="timestamp"\r\n\r\n1590961355635\r\n-----------------------------105160898611832095003078998430\r\nContent-Disposition: form-data; name="signature"\r\n\r\ne620d8972c052fffe9cc8d708d8c407296ccc99f\r\n-----------------------------105160898611832095003078998430\r\nContent-Disposition: form-data; name="api_key"\r\n\r\n779974183845587\r\n-----------------------------105160898611832095003078998430\r\nContent-Disposition: form-data; name="public_id"\r\n\r\n2020-05-31T21:42:35.619Z-17mb.mov\r\n-----------------------------105160898611832095003078998430\r\nContent-Disposition: form-data; name="resource_type"\r\n\r\nvideo\r\n-----------------------------105160898611832095003078998430\r\nContent-Disposition: form-data; name="Content-Range"\r\n\r\nbytes 0-6291455/16856005\r\n-----------------------------105160898611832095003078998430\r\nContent-Disposition: form-data; name="X-Unique-Upload-Id"\r\n\r\n2020-05-31T21:42:35.619Z-17mb.mov\r\n-----------------------------105160898611832095003078998430\r\nContent-Disposition: form-data; name="file"; filename="2020-05-31T21:42:35.619Z-17mb.mov"\r\nContent-Type: application/octet-stream\r\n\r\n-----------------------------105160898611832095003078998430--\r\n'
response:
{"done":false,"bytes":6291456,"kind":"upload","resource_type":"video","public_id":"2020-05-31T21:42:35.619Z-17mb.mov"}
However, when I upload the last chunk I get a 400 error with the following error message
{"error":{"message":"Invalid value 81 for parameter type"}}
Do you have some idea why this might be happening? I've tried varying the parameters & headers in all combinations I could think of, but I couldn't get find a combination that would work.
Thank you,
-
I figured it out - Resumable.js avoids sending very small chunks and makes the last chunk potentially bigger than chunkSize. One can avoid this sutuation by setting forceChunkSize to true in Resumable.js
It looks like Cloudinary doesn't handle chunks bigger than what was implicitly indicated in the first request, even when the Content-Range header indicates the correct range. Ensuring that the last chunk is smaller than the chunk size avoids the problem.
Thank you,
0 -
Hi Maksim,
Thanks for your updates, glad you've found the cause of this.
0
Post is closed for comments.
Comments
2 comments