6

Googleドライブファイルへの直接リンクがあるので、それらのリンクからダウンロードできますか? 一時的なリンクでも十分です。

私が理解したように、webContentLink はブラウザーでのみ使用でき、downloadUrl は小さなテキスト ファイルに使用でき、XMLHttpRequest などで使用する必要があります。

4

1 に答える 1

6

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.
于 2013-04-23T13:42:47.167 に答える