问题
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
回答1:
Try downloading the file in chunks using the range
http header. See https://developers.google.com/drive/v3/web/manage-downloads "Partial download"
来源:https://stackoverflow.com/questions/41464637/google-drive-rest-api-v3-downloading-large-files-with-alt-media-option-25mb