Is there some kind direct links for google drive files, so I could download them by their links? Even temporary links would have been enough.
As I understood, webContentLink can be used only by browsers, downloadUrl can be used for small text files and shoud be used with something like XMLHttpRequest or something else.
webContentLink
and downloadUrl
are the two main links you may use to download a Drive file.
downloadUrl
requires you to authorize using OAuth 2.0 (append the access token to the URL using downloadUrl + "&access_token=" + access_token
or using the Authorization HTTP header). It can be used to download files of Any size. Not sure what made you believe it's only for small text files. It's not. The downloadUrl
is a temporary URL that is valid around 24h.webContentLink
requires the user to be signed in a Google Account. Basically, it uses cookie authorization which is why we usually say it's to be used in a browser. However there is another interesting use-case for that link: If your file is shared publicly then this link does not require any kind of authorization whereas downloadUrl
still needs you to use an OAuth 2.0 access token. The webContentLink
never expires.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With