Download File

Hi,

Im about to start a workflow to download a file from an email. I then want to use this file and post it in slack.
If I download the file, where is it? How can I reference it?
Firstly Is this possible?

Use Case:
I get the Intel471 - Periscope Update email. In this email source is a link to a download PDF. I would like to download this PDF and post to our security slack channel.

You can’t post the file directly back to slack. Slack has an “attachments” input, but it’s a special term used in slack and not a real “attachment.”

What you can do is take the file from the email and save it via FTP, SCP, SMB, or Git and post that link to slack.

thanks for replying, say I use the get url, or FTP plugin to download it… I would then have to host the file in order to post the link to the url?

I can see there is a google drive plugin and can upload to the company google drive. How can I then change the sharing permissions on it and get the shared URL to use?

just a question…when I add an attachment from my local computer to slack, I dont link to it, I upload it… just seems strange

Correct.

The file contents will pop out of whatever email plugin you’re using as a file attachment. So it will be something like.

{{["email"].["file_attachments"]}}

In that you’ll have an object that has:

file_name
file_type
file_contents

The file_contents field will have the file contents in base64 encoded bytes. That you can feed into any of the “file” plugins and save to a 3rd location that you can then reference in a message in slack.

just a question…when I add an attachment from my local computer to slack, I dont link to it, I upload it… just seems strange

It is, and I agree. I’m trying to get us to change our documentation around that.

As to your question about drive. Instead of setting permissions on the file, save it to a shared folder. That way it will inherit shareable permissions.

Cool, thanks for this.
Can I clarify in the email there is no attachment. Its in the email source to
DOWNLOAD PERISCOPE (https://i7.t.hubspotemail.net/filelink)

If the file isn’t attached, it’s just a link, you’ll have to use a URL analysis tool of some sort on it.