Resumeable google-photos-api final call returns "not a multiple of the 262144 byte chunk granularity."

42 views Asked by At

I am following the information on uploading large files to Google Photos here - https://developers.google.com/photos/library/guides/resumable-uploads

I am using the pattern described here - https://github.com/tanaikech/Resumable_Upload_For_WebApps/blob/master/index.html

Everything goes OK until the last chunk upload which has a return status of 400 and message "The client sent 259638 bytes, which is not a multiple of the 262144 byte chunk granularity."

As this is the last chunk it of course is not 262144 in length. The doco says to use X-Goog-Upload-Command: Set to upload. For the last chunk, set to upload, finalize

It seems to be ignored.

Any suggestions?

1

There are 1 answers

0
Paul-CNB On

Ok, so after checking the header on the last call it was clear I wasn't setting the header correctly X-Goog-Upload-Command: upload, finalize Fixed the test to check if reached last call and now setting header correctly and all is good