How to save Gmail attachments to Google Drive automatically
Invoices, receipts, signed contracts: they arrive by email and should end up in a Drive folder, where you can find them and share them.
What Gmail can do on its own
Gmail filters can label, archive, delete, star or forward the emails they match (Gmail Help). Saving to Drive is not one of the actions.
With Auto Forward Rules
Auto Forward Rules is a Google Sheets template where each row is a rule. For this case, the rule only needs a search and a Drive folder:
| Gmail search | Drive folder (ID or URL) | Label | Include old emails |
|---|---|---|---|
from:@supplier.com has:attachment filename:pdf | paste the URL of your "Invoices" folder | Invoices | yes |
What it saves, for each email:
- A PDF of the email, with the sender, recipient, date and subject at the top.
- Its attachments, as the original files. An email with attachments gets its own subfolder named after its date and subject, with the PDF and the files inside.
The rule runs every hour. With Include old emails, it also works through the emails that already match, in batches. Each email is saved once; a second run never duplicates it.
Use Gmail's search operators to aim the rule: has:attachment, filename:pdf, filename:invoice.pdf, after:2025/01/01 (Gmail search operators). Start the rule in simulate mode: the Log sheet lists every email it would save before it saves anything.
A rule can also forward the same emails to one or more addresses, in the same row. Saving to Drive without forwarding does not use Gmail's daily sending limit.
The files are saved in your own Drive, by a script that runs in your own Google account. Saved files count toward your Google storage, which is shared across Drive, Gmail and Photos (Gmail Help).
USD 39, one-time. 30-day refund, no questions asked.
This is a template you copy into your account, not an app from Google's store. When you authorize it, Google shows a “Google hasn't verified this app” screen. How it works walks through every step.
Checkout isn’t open yet. This button will work as soon as it is.
Sources
- Gmail Help, "Create rules to filter your emails": https://support.google.com/mail/answer/6579?hl=en (checked 2026-11-28)
- Gmail Help, "Refine searches in Gmail" (search operators): https://support.google.com/mail/answer/7190?hl=en (checked 2026-11-28)
- Gmail Help, "Send attachments with your Gmail message" (storage): https://support.google.com/mail/answer/6584?hl=en (checked 2026-11-28)