I am in the process of building my first application that makes use of Google Apps Script & HTMLService. I need to have a form that allows the upload of a file to a Google Documents List. This is my current code and it doesn't work .
index.html : This page contains a simple form (action="<=? action ?>") with a input file (name & id equal myFile) and submit button
code.gs :
function doGet(e) {
var template = HtmlService.createTemplateFromFile(index.html');
template.action = ScriptApp.getService().getUrl();
return template.evaluate();
}
function doPost(e) {
var template = HtmlService.createTemplateFromFile('Thanks.html');
var f = DocsList.createFile(e.parameter.myFile);
return template.evaluate();
}