I\'d really like to use a form in my app, and the official Google example doesn\'t work.
Passing a form as a parameter to a function, prevents the function from being ca
Here is a workaround I have for file upload from a form in IFRAME mode. This supports multiple files:
code.gs
function doGet() {
return HtmlService.createHtmlOutputFromFile('index').setSandboxMode(HtmlService.SandboxMode.IFRAME);
}
function saveFile(data,name) {
var contentType = data.substring(5,data.indexOf(';'));
var file = Utilities.newBlob(Utilities.base64Decode(data.substr(data.indexOf('base64,')+7)), contentType, name);
DriveApp.getRootFolder().createFile(file);
}
index.html