Tim
Tim

Reputation: 55

How to save a file from URL to Google Drive

is there a way to automatically download a file "example.com/example.zip" directly to my Google Drive instead of downloading it to my server and uploading it again?

Upvotes: 0

Views: 1194

Answers (1)

Aerials
Aerials

Reputation: 4419

In Drive API there is no method to upload a file directly from a URL, with files.create you still have to upload the media. But if you don't want to use your server, you can go for Apps Script, which gives you access to the Drive API via the Advanced Drive Services, as well as the Built-in Drive service, plus some other services like Url Fetch Service with which you could make a request to download from the URL of the file and capture the blob; then use DriveApp.createFile(blob) to upload to Drive.


The beauty of it, it all happens in the cloud in Apps Script servers. Of course you are subject to Apps Script's and Drive API's quotas and limits.

Upvotes: 1

Related Questions