I am trying to download html and save it to a local file using Google Apps Script.
Here is the code:
function save_url(url, filename) {
var html = UrlFetchApp.fetch(url).getContentText();
// None of the following work.
DocsList.createFile(fileName, html);
jobFolder.createFile(filename, html, MimeType.PLAIN_TEXT);
DriveApp.createFile(filename, html);
return txt;
}
But it doesn't work. Is there a way to do this?