# Save Gmail attachments to Google Drive automatically

[Español](https://pushbuild.com/es/free/scripts/save-gmail-attachments-to-drive/) · [Português](https://pushbuild.com/pt/free/scripts/save-gmail-attachments-to-drive/) · [Deutsch](https://pushbuild.com/de/free/scripts/save-gmail-attachments-to-drive/) · [Français](https://pushbuild.com/fr/free/scripts/save-gmail-attachments-to-drive/)

**Short answer:** Use a free Google Apps Script that saves the attachments from the emails you choose into a Drive folder every 15 minutes and logs each file in your sheet. It runs in your own Google account; nothing is sent to us. Setup takes 5 steps: Make a Drive folder; Make a Settings tab; Paste the script; Turn it on; What it does.

## How to set it up

1. **Make a Drive folder.** Create a folder in Google Drive for the files and copy its link.
2. **Make a Settings tab.** Open a new Google Sheet and add a tab called Settings. In B1, write which emails to take, as a Gmail search, such as `from:billing@supplier.com` or `subject:invoice`. Paste the folder link in B2.
3. **Paste the script.** Open Extensions, then Apps Script, paste in the code from our email, and save. Reload the sheet and a **Attachments** menu appears.
4. **Turn it on.** Choose **Attachments**, then **Save every 15 minutes** (or Save attachments now to run it once). Google asks for permission the first time, because the script reads your mail and writes to your Drive.
5. **What it does.** Each attachment is saved to the folder under its own name, and a row goes in the Saved tab with the date, sender, subject, file name and a link. The email gets a **Saved to Drive** label so it is never saved twice.

Setup, step by step: 5 steps, done in your own Google account.

[Want this set up for your business? Free written scope in 20 minutes](https://pushbuild.com/scope.html?topic=Set%20up%3A%20Save%20Gmail%20attachments%20to%20Google%20Drive%20automatically)

## Get the script

### Download it free

We'll email you the script (`Code.gs`). It runs in your own Google account; nothing is sent to us.

### Have us install it for you

We set it up in your own Google account for you and check that it runs.

[Have us install it](https://pushbuild.com/services/workflow-automation.html?need=snippet-install:save-gmail-attachments-to-drive#contact)

## Good to know

- Images placed inside the body of an email, such as logos in signatures, are skipped.
- Each run handles up to 50 email threads, so a large backlog is cleared over a few runs.

## Questions

**What does this script do?**

It is a free Google Apps Script that saves the attachments from the emails you choose into a Drive folder every 15 minutes and logs each file in your sheet.

**How do I set it up?**

In 5 steps: 1. Make a Drive folder; 2. Make a Settings tab; 3. Paste the script; 4. Turn it on; 5. What it does. The full steps are on this page.

**Is it free, and does it send my data anywhere?**

It is free: enter your email on this page and we email you the script (`Code.gs`). It runs in your own Google account; nothing is sent to us.

**Can you install it for me?**

Yes. We set it up in your own Google account for you and check that it runs.

Want this connected to the rest of your tools? [Send us a short brief](https://pushbuild.com/services/workflow-automation.html#contact).

**Pushbuild** · Automate your business with Pushbuild: [pushbuild.com/contact](https://pushbuild.com/contact)

---
As of 2026-11-23. Source: https://pushbuild.com/free/scripts/save-gmail-attachments-to-drive/
