我正在構建我的第一個使用Google Apps腳本&HTMLService的應用程序。我需要一個允許將文件上傳到Google文檔列表的表單。 這是我當前的代碼,它不起作用。GAS:使用HTML服務上傳文件
的index.html: 此頁面包含一個簡單的表單(行動= 「< =動作>?」)的輸入文件(名稱& ID等於MYFILE),並提交按鈕
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();
}
請更具體的不是「它不工作」,並解釋正在發生的事情。 – 2012-08-14 12:56:24
函數DocsList.createFile(e.parameter.myFile) 返回此錯誤:找不到方法createFile(string)。我該怎麼做才能用HTMLService上傳文件?plz – user1596862 2012-08-14 20:50:18