Giter VIP home page Giter VIP logo

download-all-attachments-from-a-gmail-conversation's Introduction

How To Download All Attachments From A Gmail Conversation

Sometimes you want to download all the attachments in a long, many-message Gmail conversation. Gmail doesn't provide any simple way to do this. But these two methods seem to work:

If the attachments are less than 25MB in total

  1. Open the conversation
  2. Click the "More" dropdown and select "Forward all"
  3. Forward the full conversation to yourself
  4. Open the forwarded email, scroll to the bottom, and click the "Download all attachments" button

[h/t David Sottimano]

If the attachments are more than 25MB in total

This approach worked for me, though ⚠⚠⚠ your mileage may vary ⚠⚠⚠ :

  1. Open the conversation (ideally in a new window, but not necessary).
    • Note: Make sure that all messages in the conversation are open (i.e., not collapsed). One way to do this is to mark the conversation as unread, and then reopen it.
  2. Open your browser's developer console
  3. Paste the following JavaScript into the console:
(function () {
    var interval_seconds = 1000;
    var links = [].slice.apply(document.querySelectorAll("a[role='link']"));
    var urls = links.map(function (x) {
        return x.parentNode.getAttribute("download_url").match(/https:\/\/[^:]+$/)[0];
    });
    var timer = window.setInterval(function () {   
        if (urls.length) {  
            window.open(urls.pop())
        } else { window.clearInterval(timer); }
    }, interval_seconds);
}).call(this);

This will start the process of downloading the attachments. Every second, your browser will open a new tab, which will download a particular attachment and then close itself when the download has completed.

Notes

  • Currently only tested in Chrome
  • Some time interval seems to be necessary to avoid Gmail temporarily blocking your account, but the choice of one-second interval above is somewhat arbitrary

download-all-attachments-from-a-gmail-conversation's People

Contributors

jsvine avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.