0

How to zip and unzip files using google app script?

I want that to be attached in a mail I send. I am working on an automated sheet that logs the issue and solutions are drawn as a drawing from people. So I want that to pass on to other person via an automated mail.

I will be happy if anybody knows how to attach multiple files in drive with a specific name using app script.

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
  • https://stackoverflow.com/questions/13259041/creating-a-zip-file-inside-google-drive-with-apps-script Do some research and you'll find plenty on it. – James Sheard Sep 25 '17 at 15:22

1 Answers1

0

As an addition to the comment, you can use the code below from the SO post to send an email with multiple attachments.

function sendEmail() {

var Rainfall = DriveApp.getFilesByName('Files1.doc')
var Rainfall2 = DriveApp.getFilesByName('Files2.png')

MailApp.sendEmail({
to:"mymail@gmail.com", 
subject: "Images for Social Media", 
body:"Hi Joe, here are the images for Social Media",


attachments: [Rainfall.next(), Rainfall2.next()]
  })

}
sendEmail()

Note: Change the value of Files1.doc and the rest to the file you needed to be sent.

MαπμQμαπkγVπ.0
  • 5,887
  • 1
  • 27
  • 65
  • Yeah, thanks for the reply. But my Exact requirement is that i have a fle attachment in google sheet and it is unfortunately zip file, so i want to unzip that folder and send the multiple attachment in that unzipped folder in mail. So here i jst want to know the script or Zipping the files and unzipping the files. so can you help me clearly on this poit. – Santhosh Kumar Sep 27 '17 at 04:36