·Updated ·Dioveo Team· 8 min read

How to Bulk Download Gmail Attachments

Gmail
Attachments
Productivity
Tutorial
How to Bulk Download Gmail Attachments

Gmail has no button that downloads attachments from several emails at once. Its Download all option works inside one email. To get files from many emails in one go, you have three practical routes: a tool that searches your whole mailbox and builds one ZIP (Dioveo), a full mailbox export with Google Takeout, or a free Google Apps Script that saves matching attachments to Google Drive.

Whether you're an accountant pulling a year of invoices, a project manager collecting deliverables, or someone clearing out an inbox, the steps below get your files out of Gmail at scale. Start by deciding which files you need: a precise search like has:attachment filename:pdf from:[email protected] makes every method faster. Our guide to Gmail attachment search operators lists the useful ones.

Which Method Should You Use?#

MethodBest forAcross many emails?ResultFree?
DioveoFiles from a search, a sender or a whole mailboxYes, in one selectionOrganized ZIP, or upload to Drive, Dropbox or OneDrive50 files a month free, then paid
Google TakeoutA complete backup of everythingYes, the whole mailbox or chosen labelsMBOX archive that still needs extractingYes
Apps ScriptSaving files that match a search to Google DriveYes, in batchesFiles in a Drive folderYes
Gmail's Download allSeveral files in one emailNo, one email at a timeZIP of that email's filesYes

In short: use Dioveo when you want the actual files from many emails in a folder structure, Takeout for a full archive, Apps Script if you're comfortable with a little code and want the files in Drive, and Gmail's own button for a single message. We also compared the best Gmail attachment downloaders, extensions and desktop apps included.

How to Download Attachments From Multiple Emails as One ZIP#

This is the fastest route when the files are spread across dozens or thousands of emails.

  1. Connect Gmail. Sign in to Dioveo with your Google account. It indexes the attachments in your mailbox in the background; wait for indexing to finish before selecting all matches.
  2. Find the files. Filter by sender, file type, date or keyword. For example: PDFs from one supplier received in 2025.
  3. Choose all matching files. Leave the files unselected, open All N matches above the filtered results, and choose Download all matches. This covers every matching attachment, not just the first page.
  4. Choose the layout. Select By sender, then year, By sender, By year or All in one folder, then click Download.
  5. Open the ZIP. Even very large selections arrive as one ZIP. If any file could not be included, Dioveo lists it rather than silently dropping it.

Prefer the files in cloud storage? Choose Upload all matches instead to send the same files to a folder in Google Drive, Dropbox or OneDrive. To take everything without filters, select the page and choose Export all N to open the whole-mailbox export.

Free includes 50 files per month across downloads and manual cloud saves. Pro makes downloads and manual cloud saves unlimited. Whole-mailbox export requires Pro or a one-time export purchase. It connects through Google's official OAuth sign-in and never sees your password.

How to Download All Attachments From a Single Email#

When one email has several attachments, hover over the attachment area at the bottom of the message and click Download all. Gmail bundles that email's files into one ZIP in your downloads folder. It only works one email at a time; the single-email guide covers the details and what to do when the button is missing.

How to Bulk Download Attachments with Google Takeout#

Google Takeout is Google's official data export service, and it can hand you a copy of your entire Gmail account, attachments included.

  1. Go to takeout.google.com while signed into your account.
  2. Click Deselect all so nothing is selected.
  3. Scroll down and check only Mail.
  4. (Optional) Click All Mail data included to limit the export to specific labels instead of your whole mailbox, which keeps the download smaller.
  5. Click Next step, choose your delivery method (email link, Drive, Dropbox, or OneDrive), file type (.zip), and size, then click Create export.
  6. Google compiles the archive in the background. For large mailboxes this can take anywhere from minutes to a day or more, and you'll get an email when it's ready.

Set your expectations here. Takeout does not give you a tidy folder of individual attachment files. It exports your mail in MBOX format: one large file containing every message with its attachments encoded inside. To get the files back out, use our free Google Takeout attachment extractor. Unzip the download, choose its .mbox file, then filter and export PDFs, photos or other files into an organized ZIP. It runs in your browser, without a Gmail connection or signup. Review any skipped-message notices before relying on the export.

Takeout is the right tool when you want a complete archive before a big cleanup. If your goal is to free space afterward, pair it with our guide to free up Gmail storage after downloading. But if you just want the actual attachment files in a folder, the Apps Script method below is far more direct.

How to Bulk Download Gmail Attachments with Google Apps Script#

Google Apps Script is a free scripting platform built into your Google account. With about a dozen lines of code, you can iterate over a Gmail search and save every matching attachment straight into a Google Drive folder, no MBOX parsing required.

Step 1: Create the script

  1. Go to script.google.com and create a new project.
  2. Delete the placeholder code.
  3. Paste the following:
function bulkDownloadAttachments() {
  // The Drive folder where attachments will be saved
  var folder = DriveApp.getFolderById('YOUR_DRIVE_FOLDER_ID');

  // Adjust this query to match the attachments you want
  var query = 'has:attachment -label:downloaded';
  var label = GmailApp.getUserLabelByName('downloaded') ||
    GmailApp.createLabel('downloaded');

  var threads = GmailApp.search(query, 0, 20);

  threads.forEach(function (thread) {
    thread.getMessages().forEach(function (message) {
      // Real attachments only: inline images such as logos are excluded
      var attachments = message.getAttachments({
        includeInlineImages: false,
        includeAttachments: true
      });

      attachments.forEach(function (attachment, index) {
        // Message ID + position makes each name unique, so reruns skip
        // files already saved without dropping same-named attachments
        var name = message.getId() + '_' + index + '_' + attachment.getName();
        if (!folder.getFilesByName(name).hasNext()) {
          folder.createFile(attachment.copyBlob().setName(name));
        }
      });
    });

    // Mark the conversation as processed only after all its messages
    thread.addLabel(label);
  });
}

Step 2: Point it at a folder and run it

  1. Create (or open) a folder in Google Drive and copy its ID from the URL: the part after folders/.
  2. Paste that ID in place of YOUR_DRIVE_FOLDER_ID.
  3. Edit the query to target what you need, using the same operators you'd type into Gmail's search bar (for example has:attachment from:[email protected] after:2025/01/01). Keep -label:downloaded in it. GmailApp.search returns conversations: the script saves every non-inline attachment from every message in each returned conversation, including messages outside your sender or date filters and files outside a filename filter.
  4. Save, then click Run. Authorize the permissions the first time.

The script processes up to 20 conversations per run, saves their attachments to Drive, and applies a downloaded label so finished conversations are skipped next time. Reruns skip files already saved under their generated names. Run only one execution at a time. Run it again to process the next batch, or add a time-based trigger (the clock icon in the editor) to have it run on a schedule.

A couple of limits to know: Apps Script executions are limited to six minutes and are subject to Gmail service quotas, trigger-runtime limits and available Drive storage. For very large mailboxes you'll run it in batches. This is the same approach we cover in more depth in the guide to saving Gmail attachments to Google Drive automatically. Once your files are in Drive, you've effectively bulk downloaded them and they're searchable and shareable.

Can You Bulk Download Gmail Attachments on iPhone or Android?#

No. The Gmail apps save one attachment at a time and have no multi-select for files. For many attachments, use a desktop browser with one of the methods above; Dioveo and Apps Script also work from any device because the work happens online. For saving single files on a phone, see downloading Gmail attachments on iPhone.

Why Use a Dedicated Tool for Repeat Downloads#

The free methods work, but you run them yourself every time, and a script needs fixing when something changes. If you pull attachments regularly, for example every month's invoices, that adds up.

Dioveo keeps your attachment index up to date, so you can repeat the search as new attachments are indexed. You can also set rules so future attachments are saved automatically to Google Drive, OneDrive or Dropbox. It is Gmail-only, and heavier volume needs a paid plan.

Frequently Asked Questions#

Can I download all Gmail attachments at once?

Not with a native Gmail button. Gmail's Download all works inside one email. To download attachments from your whole mailbox or a large search at once, use a tool like Dioveo that prepares matching attachments as one ZIP and reports files it could not include, Google Takeout for a full MBOX export, or a Google Apps Script that saves matching attachments to Drive.

How do I download attachments from multiple emails?

Search for the emails you need, then use a tool that can select attachments across all of them. In Dioveo, filter the attachments, open All N matches and choose Download all matches to get them as one ZIP. Free alternatives are Google Takeout (a full archive you then extract) and an Apps Script that loops through a Gmail search and saves the files to Google Drive.

Is there a free way to bulk download Gmail attachments?

Yes. Google Takeout and Google Apps Script are free and built into your Google account. Takeout gives you a full backup in MBOX format, which our free extractor turns back into files, while Apps Script saves individual files to Google Drive based on a search you define. Dioveo's Free plan also covers 50 files per month across downloads and manual cloud saves.

Where do downloaded Gmail attachments go?

ZIP downloads, from Gmail's own button or from Dioveo, land in your browser's default download folder. Apps Script saves to the Google Drive folder you choose, and Dioveo can upload directly to Google Drive, Dropbox or OneDrive instead. On mobile, you pick the destination from the share sheet.

Stop managing attachments by hand

Dioveo finds every attachment in your Gmail, lets you search and download them in bulk, and auto-saves new ones to Google Drive, Dropbox, or OneDrive.

CASA Tier 2 assessed GDPR compliant Permanent Free plan Cancel anytime

Keep reading