Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Google Drive Rest API V3 Errors | Failed to parse Content-Range Header
New on LowEndTalk? Please Register and read our Community Rules.

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

noamannoaman Member
edited March 2019 in Help

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

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 :neutral:

  • Adam1Adam1 Member

    Same error?

  • Yep !!!

    I think i am making a very basic error not sure what...

  • CConnerCConner Member, Host Rep

    @noaman said:
    Yep !!!

    I think i am making a very basic error not sure what...

    Isn't Stackoverflow the place for questions like these?

    Thanked by 1dedipromo
  • @CConner said:

    @noaman said:
    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 :neutral:

  • The first part has already been sent and ACK'd, right?

  • @Letzien said:
    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 :smirk:

    Thanked by 1Prayag
Sign In or Register to comment.