Does webContentLink work in Google Drive downloading?

Can you use the HTTP Get a File call with the webcontentlink URL returned from Google Drive’s Wath Files in a Folder? Seems it returns an error where as it should just download the file.

I sent this input bundle to HTTP get a file

[
{
“url”: “Google Drive - Virus scan warning”,
“method”: “get”,
“serializeUrl”: false,
“shareCookies”: false
}
]

and I get this back:

Sorry, the owner hasn't given you permission to download this file.

Only the owner and editors can download this file. If you’d like to download it, please contact the owner.

The file is set to share publicly on the internet

It appears the module can’t download the file because it is too large.

The error message may be misleading.

The settings on the file have to be set to anyone with the link and they must be an editor. So the error was correct. The permissions were not exactly right.

But you’re right about size. I found a download link that does work by inspecting the web page that shows up when I attempt to do it. There is a “download anyway” button that has a special at query string which enables the download to work anyway. It has a token and a timestamp in it which probably expires.

I was able to get the download file via the Google Drive API with this GET CALL:

https://www.googleapis.com/drive/v3/files/{{id}}/?key={{Google Cloud App API KEY}}&alt=media

The {{id}} is the File ID of the Google Drive file to download available in the URL of the file.

The {{Google Cloud App API Key}} is configurable through well known instructions on adding a Google Cloud app.. But you don’t need any oAuth stuff - just a credential needs to be created called API key.

2 Likes