Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to programmatically download a public Google Drive file?

I have a backend server that has to download a file on Google Drive that has been shared to public by the owner. Our clients are emailing us the link and we get the link from the email -- no UI is involved. The program needs to get or download the file and process it offline .

The google samples seem to be runnig using the UI where as this is a automated backend process.Also, this application is to running on my server and not on Google App Engine . Do I still need to register my app if all I am doing is acessing files shared to public by the owner.

For reference , please note that it is trivial to download /wget a file shared on Dropbox .

like image 841
user193116 Avatar asked Jun 26 '12 20:06

user193116


People also ask

How do I download from public Google Drive?

Go to drive.google.com. Click a file to download. click any other files.


2 Answers

This is an older question (and already has an accepted answer), but Google just announced a new way to tackle this problem that makes it quite a bit easier to solve; basically, you can now (as of 11/28/2012) make a folder and set the folder to be public, and then any file put in the folder can be downloaded via HTTP GET without ever getting an intermediate page (regardless of the filesize). Details:

http://googleappsdeveloper.blogspot.com/2012/11/announcing-google-drive-site-publishing.html

like image 180
jlmcdonald Avatar answered Sep 17 '22 20:09

jlmcdonald


You don't need any Google SDK if you know the link and the file is public. Just use a standard HTTP GET method to download the file.

like image 26
Takahiro Avatar answered Sep 19 '22 20:09

Takahiro