Reputation: 41
I am trying to figure out how I can download a large binary file directly in the browser via the Google Drive API V3.
According to the Drive API manual there are three different ways to download files via the API:
alt=media
file resourcefiles.export
webContentLink
from the file resourceOption (2) isn't useful in my case as the files aren't Google Docs files and Option (3) isn't a solution as this will redirect the user to a warning that Google Drive can't scan big files for virusses.
This leaves me with option (1). This works almost perfectly and I can successfully redirect the user to the file via the alt=media attribute e.g.:
Although this will start the download in the Browsers, it will be named with the ID of the file instead of the original File Name. Which is quite confusing.
So my question is: How can I download large files (>25MB without virus warning) via the Google API with the right file name?
NOTE 1: Downloading the file via cURL on the server before and sending the output to the browser isn't an option in my case.
NOTE 2: Furthermore, the files can't be shared. That's why I am using the API.
Upvotes: 2
Views: 3753