Reputation: 935
I have exported some files from my Google Drive, and it is sized 1.95 GB I want to download it to one of my web hosting account directly. I do not like to download to my PC first and then upload to the server.
I think Google Drive API should be the solution. I have used it for individual files from Google Drive very well. But I am worried how to use it for exported file.
Please suggest me how to do it this way or otherwise.
I prefer PHP script, if that matters.
EDIT : Explained more
I have worked much with Drive API and developed applications based on it too. But the problem is that, this time I am not downloading single regular file from Google Drive, rather I have exported an entire folder containing several files as a zip archive. The download link is sent to my email.
Now to download that archive I must be logged into Google account. Due to slow speed at my home I prefer to download it to my web hosting server directly. This is what I am trying to achieve.
Upvotes: 1
Views: 3161
Reputation: 2987
If you have no experience with Drive API, start from PHP Quickstart. It will show you how to handle authentication and basic API query. Then, you can use Files.get() if you know the file id or you can use Files.list() to find files with search queries. As a response of this query, you will get Files resource. From files resource, if it is Google Docs(or Spreadsheet, Presentation, etc) file, you can get exportLinks in various formats or you will get downloadUrl which you can download both of them. Files.list() and Files.get() both have some php code to take a look at.
Have fun!
Upvotes: 2