Heen Shaik
Heen Shaik

Reputation: 1

How to partially download google drive files?

I am trying to download specific bytes of a file from google drive. When I set bytes=0-1000, it works fine. When I am specifying a particular range of bytes (as shown below), the size of the video getting downloaded is correct but, I couldn't play the video.

HttpRequest httpRequestGet = drive.getRequestFactory().buildGetRequest(new GenericUrl(url.toString()));
httpRequestGet.getHeaders().setRange("bytes=" + 10000 + "-" + 200000);

Am I missing something? Thanks in advance.

Upvotes: 0

Views: 768

Answers (1)

Partha Das
Partha Das

Reputation: 180

It could be probably because by specifying a byte range further down in the file you are skipping the entire header of the file, which results in just a garbled block of data.

Upvotes: 1

Related Questions