How to Export Only PDF or Image Attachments from Gmail
filename: operator — for example has:attachment filename:pdf for PDFs or filename:(jpg OR png) for images — then use a local exporter to download just those files. You get every matching attachment on your disk without wading through unrelated mail, and nothing is uploaded.Sometimes you do not want every attachment — you want every invoice PDF, or every photo, or every spreadsheet someone sent you. Gmail can find them precisely, and a local exporter can pull just those files to your disk. This guide shows the search operators that isolate attachments by type and how to download them cleanly.
The operator that filters by file type
The key is Gmail's filename: operator, which matches on the attachment's name and extension. Combine it with has:attachment for reliable results:
has:attachment filename:pdf— every message carrying a PDF.has:attachment filename:(jpg OR png OR jpeg)— image attachments.has:attachment filename:(xlsx OR csv)— spreadsheets.has:attachment filename:(doc OR docx)— Word documents.has:attachment filename:invoice— files whose name contains "invoice", regardless of type.
You can stack these with other operators to get remarkably specific: from:accountant@firm.com has:attachment filename:pdf after:2026/01/01 finds every PDF your accountant sent this year. This is the attachment-focused version of the broader search-then-export workflow.
Download only the matching attachments
Once the search shows the right messages, export their files:
- Install a local exporter. Add Gmail Exporter to Chrome. It reads the messages in your current search and saves their attachments to your device.
- Keep the filter active. Make sure your
filename:search is still in the box so only matching mail is in scope. - Export the attachments. The tool pulls the files down in one pass — the same mechanism covered in download all Gmail attachments, but scoped to a single type.
- Organise on disk. Because you filtered by type, everything lands together — all PDFs, or all images — ready to file.
Download just the file type you need
Filter by filename, then pull every matching PDF or image to your disk in one click. Free and local.
Add to Chrome — It's FreeWhy filter by type instead of grabbing everything?
Downloading every attachment you have ever received is often more than you need and harder to sort afterwards. Filtering by type gives you:
- A clean, single-purpose folder. Just the invoices for your accountant, or just the photos for an album — no signatures, logos or stray icons mixed in.
- Faster exports. Fewer files means a quicker download and less to review.
- Easier compliance. When you only need financial PDFs for a tax year, pulling exactly those keeps your records tidy and defensible.
If you do want the message context alongside the files, export the mail too — see export emails with attachments to keep each file paired with its sender and date.
Watch out for inline images
One quirk: Gmail treats logos and signature graphics embedded in messages as attachments too. A raw filename:png search can surface hundreds of tiny signature images. To avoid the clutter, add name hints — filename:(scan OR photo OR img_) — or a size-based mindset, and skim the results before exporting. The same care applies whether you are saving to disk or saving Gmail attachments to Drive.
Common recipes
| You want | Search this |
|---|---|
| All invoices as PDF | has:attachment filename:pdf invoice |
| Photos from a trip | has:attachment filename:(jpg OR png) after:2026/06/01 before:2026/06/30 |
| Spreadsheets from a client | from:client@co.com filename:(xlsx OR csv) |
| Signed contracts | filename:pdf (signed OR agreement OR contract) |
Keep it private
Attachments are often the most sensitive thing in your mailbox — contracts, IDs, financial statements. A local exporter downloads them straight from your browser to your disk, with no third-party server in the path. If that is why you are collecting them, is it safe to export your Gmail? explains what local processing guarantees.
The bottom line
To export attachments of a single type, let Gmail's filename: operator do the filtering, then download just those files with a local tool. You skip the noise, land every matching PDF, image or spreadsheet in one folder, and keep the whole thing on your own machine.
Why file type is the right lens
Attachments are not one thing; they are many jobs wearing the same paperclip icon. A contract PDF, a product photo, a spreadsheet of numbers and a signature logo all live in your mail as "attachments", but you almost never want them together. Filtering by type is what lets you pull exactly one job at a time — every invoice, every photo, every data file — without dragging along the rest. That is the difference between a folder you can use immediately and a jumble you have to sort by hand.
Build a reusable set of searches
The real power of the filename: operator is that your searches become reusable recipes. Save the ones you run often and you have an instant retrieval system:
| Goal | Reusable search |
|---|---|
| Tax-year invoices | filename:pdf (invoice OR receipt) after:2026/01/01 before:2026/12/31 |
| Design assets | filename:(png OR jpg OR svg OR ai) |
| Data files from a team | from:@team.com filename:(csv OR xlsx) |
| Signed legal docs | filename:pdf (signed OR executed OR agreement) |
Each of these narrows Gmail to a precise set before you export, so the download lands as a ready-to-use collection rather than a pile to triage.
Organising what you pull down
Because you filtered by type, the files arrive coherent — but a little structure at download time pays off later. Give each export its own dated folder ("2026-invoices", "june-trip-photos") so you never mix batches. If you export the same type regularly, keep a consistent naming scheme, and future-you will find any file in seconds. For attachments you want to keep in the cloud rather than on disk, the same filtered search feeds directly into saving them to Drive.
Common pitfalls and how to avoid them
- Signature graphics flooding image searches. Add name hints or exclude tiny logos by searching for real photo keywords, so you get pictures rather than branding.
- Missing files because of extension variants. A photo might be
.jpgor.jpeg; a document.docor.docx. Use OR to cover both. - Duplicates across threads. The same attachment forwarded several times appears more than once. A quick de-duplicate after download keeps your folder clean.
- Forgetting the context. A file alone can be ambiguous. If you may need to know who sent it and when, export the messages with their attachments instead of the files alone.
A practical archiving routine
Turn this into a habit and your important documents stop living only inside email. Once a quarter, run your saved filename: searches for invoices, contracts and any other must-keep files, export them to dated folders, and back those folders up. Email is a fine place to receive documents but a poor place to store them long term — accounts get locked, attachments expire from view, and search gets slower as volume grows. Pulling the files out by type on a schedule gives you a durable, well-organised archive that does not depend on your mailbox at all.
The bottom line, in one sentence
The paperclip icon hides a dozen different jobs, and the filename: operator is how you separate them: search for one type, export just those files locally, and you get a clean, single-purpose folder of every invoice, photo or spreadsheet without the clutter of everything else. Turn your most-used searches into saved recipes, run them on a schedule, and the documents you actually need stop living inside email and start living in organised folders you fully control.
Frequently asked questions
How do I export only PDF attachments from Gmail?
Search has:attachment filename:pdf in Gmail, then use a local exporter to download the attachments from those messages. Only the PDFs are pulled to your disk, with no unrelated files mixed in.
Can I export only image attachments?
Yes. Search has:attachment filename:(jpg OR png OR jpeg) to match image files, then export. Add date or sender operators to narrow to a specific batch of photos.
What is the filename operator?
filename: is a Gmail search operator that matches an attachment's name or extension. filename:pdf finds PDFs, filename:invoice finds files named with 'invoice', and you can combine several with OR.
Why do tiny logo images show up in my search?
Gmail treats embedded signature and logo graphics as attachments, so a broad image search can surface them. Add name hints like filename:(scan OR photo) or review the results before exporting to skip the clutter.
Can I keep the email with each attachment?
Yes. Instead of downloading files alone, export the messages with their attachments so each file stays paired with its sender, subject and date for context.
Is downloading attachments by type private?
Yes with a local browser tool. The files are pulled from your browser straight to your disk, so sensitive attachments are never routed through a third-party server.