Skip to main content

I like to download a document which can be retrieved by a direct link.

So I receive a email, which is labeled based on the content.

ZAP1

Trigger is: new email in inbox/label

Action is: download file of directlink to specified directory

 

ZAP2

Trigger is: new file in specified directory

Action is: email file to bookkeeping

 

Is this possible? I saw that attachments can be downloaded but I was un succesful with the direct link.

 

Many thanks,

Sapje007

 

Doable if you have a Gsuite account.  😀

 

Lets go:


Here is the code snippet 🤙

import requests

id = input.get('id')
link = "https://drive.google.com/uc?id=" + id
r = requests.get(link)
redirected = r.url

output = >{'url': redirected}]

You know how to add the attachment to the folder? If not feel free to chat or write here 🚀.

Have fun 😎


Hi @Wemakefuture 

Thanks for your script.

I have no clue how to download the file, since I cannot find a zap that can do it.

The file is not send as an attachment but as a link in a email.

Can you tell what the script above is doing?. 

 

Thanks a lot!

Sapje007


Doable if you have a Gsuite account.  😀

 

Lets go:


Here is the code snippet 🤙

import requests

id = input.get('id')
link = "https://drive.google.com/uc?id=" + id
r = requests.get(link)
redirected = r.url

output = >{'url': redirected}]

You know how to add the attachment to the folder? If not feel free to chat or write here 🚀.

Have fun 😎


Wow, it looks great! but can zapier connect to Colab?  Google Colab is free but the G-suite seems not. If Colab also works in this case that will solve my problem.

 

Anyway, thanks for the solution!