APIs & Integrations

Masakazu
Member | Gold Partner
Member | Gold Partner

download submitted file by using zapier

SOLVE

I’m working on something pretty simple, but running into trouble.

When someone submits a form with an attached file, I want to download that file.


I’m receiving about 100 files a day, and my goal is to rename them and create a list (like in Google Drive or a spreadsheet) where I can download them all easily.


The key is being able to rename the files and download them. The renaming doesn’t necessarily have to happen in HubSpot, but the filenames need to be clearly visible in the list.

Since I can’t use Operations Hub, I tried setting it up with Zapier, but nothing seems to be working so far. It looks like the issue is that HubSpot files can’t be downloaded directly via URL.

Any advice or help would be really appreciated.

0 Upvotes
1 Accepted solution
MichaelMa
Solution
Contributor

download submitted file by using zapier

SOLVE

As far as I'm aware, if you are logged into Hubspot, you should be able to download/load the private files in your browser. Zapier won't be able to do it because it's not logged into Hubspot. 

 

My issue, for reference, is I wanted people to be able to update/upload their own avatars (along with their other contact info) and the Form Submissions was marking the files uploaded as Private. So I have a workflow that triggers on Form Submission to make the file Public and update the field with the new URL.

 

Workflows

1. User Submits form

2. Form Submission triggers Workflow

3. Workflow pulls the contact and retrieves the property with the file uploaded.

4. Workflow executes a File API to make the file public no-index and/or rename title (not sure if you can rename the filename).

5. Retrieve the file data again with the updated URL.

6. Do whatever you want here for storing the info.

 

Presuming in Zapier, you would do the same process:

1. Enters Zapier (presuming on form submission)

2. Takes the property field for the file and gets the ID.

3. Execute a Webhook for the Files API using the ID and makes the file public no-index and/or rename file (again, not sure you can rename the filename but you can probably rename the file "title").

4. Execute a Webhook for the Files API to retrieve the file data again to get the now public URL.

5. Stores the file URL in a Google Sheet with whatever other info you need.

 

You would need to craft the payload for Zapier webhooks since you won't have access to the API libraries that does that for you.

View solution in original post

0 Upvotes
4 Replies 4
Masakazu
Member | Gold Partner
Member | Gold Partner

download submitted file by using zapier

SOLVE

Thank you.

I will try!

0 Upvotes
MichaelMa
Contributor

download submitted file by using zapier

SOLVE

I believe the default permission for files uploaded via a Form is Private.

 

Options are either:

1. See if generating a signed URL works for Zapier to download. If it's only a 1 time event, this would probably work best and keep the file secure.

https://developers.hubspot.com/docs/reference/api/library/files/v3#get-%2Ffiles%2Fv3%2Ffiles%2F%7Bfi...

 

2. Alternative is to use the Files API to change the permissions from private to public (probably PUBLIC_NOT_INDEXABLE) so that your Zapier can download the file using the new public URL.

 

0 Upvotes
Masakazu
Member | Gold Partner
Member | Gold Partner

download submitted file by using zapier

SOLVE


Thank you.

I’m a beginner with Zapier, but I’d say I’m an intermediate-level user of HubSpot. Could you please explain it a bit more in detail?

 

I’m working with a specific form that could receive around 100 submissions per day, and it’s expected that the same contact may submit the form multiple times.

Given that, Option 2 might actually be the more effective solution.

0 Upvotes
MichaelMa
Solution
Contributor

download submitted file by using zapier

SOLVE

As far as I'm aware, if you are logged into Hubspot, you should be able to download/load the private files in your browser. Zapier won't be able to do it because it's not logged into Hubspot. 

 

My issue, for reference, is I wanted people to be able to update/upload their own avatars (along with their other contact info) and the Form Submissions was marking the files uploaded as Private. So I have a workflow that triggers on Form Submission to make the file Public and update the field with the new URL.

 

Workflows

1. User Submits form

2. Form Submission triggers Workflow

3. Workflow pulls the contact and retrieves the property with the file uploaded.

4. Workflow executes a File API to make the file public no-index and/or rename title (not sure if you can rename the filename).

5. Retrieve the file data again with the updated URL.

6. Do whatever you want here for storing the info.

 

Presuming in Zapier, you would do the same process:

1. Enters Zapier (presuming on form submission)

2. Takes the property field for the file and gets the ID.

3. Execute a Webhook for the Files API using the ID and makes the file public no-index and/or rename file (again, not sure you can rename the filename but you can probably rename the file "title").

4. Execute a Webhook for the Files API to retrieve the file data again to get the now public URL.

5. Stores the file URL in a Google Sheet with whatever other info you need.

 

You would need to craft the payload for Zapier webhooks since you won't have access to the API libraries that does that for you.

0 Upvotes