All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Google Drive Rest API V3 Errors | Failed to parse Content-Range Header
Hello there
I am trying to upload using Google Rest API to Google Drive
I am using this guide
I am using multiple chunks methods as the files are big
Now If there are not any errors I am able to upload them easily.But when there are errors I am unable to resume the uploads
To resume the upload , I need to get the last uploaded chunk
and this is the proper way to resume the upload
Example: Resume an interrupted upload
The following example shows a request for the upload status:
PUT https://www.googleapis.com/upload/drive/v3/files?uploadType=resumable&upload_id=xa298sd_sdlkj2 HTTP/1.1
Content-Length: 0
Content-Range: bytes */2000000
But using this I always get Http Error 400
Failed to parse Content-Range header.
Here is the curl command I am using
curl -I -X PUT -H "Content-Length: 0" -H "Content-Range: bytes */4138576983" "https://www.googleapis.com/upload/drive/v3/files?uploadType=resumable&upload_id=AEnB2UpZ9VXyBgVg3W7Ts5cw9XoGmCKH7hKafhY8PHhwOo-mcOhF3ZZS2n6tQKsmIulkE2CVS2ygezUCx7qZ5m1fWrILBEj4SNYpjRSK3Vk5R2FlgxjEu-o"
Here is the Post man results
Any help will be appreciated
Comments
You need to give it an actual offset, afaik
Actual offsets also gives an error
Same error?
Yep !!!
I think i am making a very basic error not sure what...
Isn't Stackoverflow the place for questions like these?
I guess it is
The first part has already been sent and ACK'd, right?
The issue is that when i have to resume the uploads I am not sure how much data has been previously uploaded
One method which currently i am using is storing each successful request in cache and using that
But i am trying to implement the method independent of this
As Documentation of Google Drive suggest
Update
This is weird
When i tried it again with another file (another upload id) the functionality is pretty normal
It does give me the appropriate response
My guess if your scripts break after generating a resumable url but before any data is uploaded then it gives you this error..
The documentation do suggests it will return a 400 error if resumable url expired but it doesn't say it will give you a failed to parse content range header
Either this
Or Google API messed up this time