Reputation: 227
I am trying to get the contents of a xlsx file with Google Script.
Step 1 is to get a blob and unzip it.
Here is my code :
var file = DocsList.getFileById(docId);
var b1 = file.getBlob().setContentType('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
var b2 = Utilities.unzip(b1)[0];
But I keep getting an "Invalid Argument" error on the last line.
Am I doing something wrong?
Upvotes: 3
Views: 1304
Reputation: 7858
Set the content type to application/zip - the unzip method won't accept anything else.
Upvotes: 3