1

I am trying to figure out how I can download a large file directly in the browser via the Google Drive API V3.

I'm using option 1 which is : Download a file — files.get with alt=media file resource

When I send my request ( https://www.googleapis.com/drive/v3/files/[fileId]?alt=media), I got the content of the file as a response of it.

Currently I'm creating a blob file with the response of my query, then reading the blob file to start the download on the browser.

The problem with that is, reading the blob file consumes a lot of memory and if the file's size is more than 10MB, then browser crashes.

So my question is : how can I start the download on browsers via the Google APIs like mention on the screenshot bellow? See expected result

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
Sarah
  • 11
  • 1
  • 5
  • You may want to check solutions and also comments in this [SO post](http://stackoverflow.com/a/24951186) wherein solution used is `https://googledrive.com/host/folder-id/filename.exe`. However, please note that this is applicable for shared folders. This [article](http://www.broculos.net/2013/04/how-to-use-google-drive-to-share-files.html#.WG24pvF96Ak) might also help. – Teyam Jan 05 '17 at 11:09

1 Answers1

0

Try downloading the file in chunks using the range http header. See https://developers.google.com/drive/v3/web/manage-downloads "Partial download"

pinoyyid
  • 21,499
  • 14
  • 64
  • 115
  • Actually, I don't get warning message for files more than 25MB, but my issue is how can I start the download in the browser. when I send the query ( https://www.googleapis.com/drive/v3/files/[fileId]?alt=media) I get something like " ÐÏࡱá>þÿ ,þÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ... " as a response. any idea? – Sarah Jan 09 '17 at 14:23