I am trying to follow up on the discussion here: Zip drive files.
If you execute the following code, you'll see that for some reason, it produces PDF files. It seems getBlob() is converting them to PDF.
var folderId = DriveApp.getFoldersByName("Test").getId();
var files = DriveApp.getFoldersByName("Test").getFiles();
var blobs = [];
var fileBlob = '';
var file = '';
while(files.hasNext()){
file = files.next();
fileBlob = file.getBlob();
blobs.push(fileBlob);
}
var zippedFolder = Utilities.zip(blobs, 'Test.zip');
DriveApp.getFoldersByName("Test").getParents().next().createFile(zippedFolder);
I download Test.zip and every file in that (like a google sheets or google docs) file has been converted into a PDF. Secondly, if the folder contains any Google Forms file, the code with fail with an error saying unable to convert forms to pdf.
I don't want to convert any file to pdf. I just want to zip the folder. Any thoughts?