Instantly Send Any Gmail Attachment To Google Drive

Now that Google Drive has built file storage into your Google account, it's only natural that you'd like it to play nicely with your other Google apps. With a few tricks, it can — at least with your Gmail account.

Tech blogger Amit Agarwal details how to set up a system in which applying a GoogleDrive label to any email in your Gmail inbox will automatically save its attachment to Google Drive — syncing those files directly to your desktop. Agarwal accomplishes the task using Google's somewhat underused Apps Script language to make this all work — none of which you actually need to know to set it up. The set-up is actually extremely easy:

  1. Assuming that you are logged in to your Google account, create a copy of this sheet in your Google Docs (now Google Drive).
  2. Open the sheet and you should see a new Gmail menu — click Initialize and grant the necessary permissions. This is your sheet (see source code) and you are not sharing your Google credentials or data with anyone else.
  3. Next go the Gmail menu again and select Run. Close the Google sheet and you are done.

Now whenever you label an email with GoogleDrive, your script (which runs every two minutes) will automatically add any attached files to your Google Drive. Awesome, right?

Now, let's say you wanted to automatically save every attachment you receive to Google Drive for easy offline access. Just set up a filter for messages that match the has:attachment search and label all matching incoming messages with GoogleDrive. Click this link for a head start on that filter; it should look something like:

If you wanted to download every single attachment in your Gmail account, just tick the checkbox next to "Also apply filter to X matching conversations" before you click the Create filter button.

Send your Gmail Attachments to Google Drive With a Click [Digital Inspiration]


    Ever since SkyDrive first came along, I've been waiting for MS to implement something like this natively. Seems Google also hasn't quite got around to it.

    Funny thing is that with Hotmail, even if you upload an attachment you have the option of either sending it *as* an attachment *or* saving it to your SkyDrive and sending a link. So the capability is more or less already there - it'd be nice if they'd just "reverse" it and let me save to my SkyDrive instead of having to download it locally!

    If you use chrome, you can use an extension called 'Gmail attachments to drive', it adds a button next to each attachment that says 'send to drive'. Click the button and that's it.

    Great script. Is there a way to deep link inside Google Drive folder to send attachment to a specific folder ?

    link to script is broken.

      @Tony - If you go to the original site, you get an updated link.

    Hi, thanks for this.
    I'm using my printer to scan to the cloud, which effectively emails to my gmail account, and this now detaches the PDF into google drive. The problem is that it keeps doing it, over and over again and I have multiple instances of the PDF file. The only way to stop this is to delete the email. How do I get it to detach each file once only?
    Thanks again

    Here is a Chrome Web App which syncs all past and new GMail attachments in GDrive. Just one click install and needs no more actions on your part

Join the discussion!

Trending Stories Right Now