I keep getting an error in Google App script when running a function with this variable:
Execution failed: TypeError: Cannot find function getContentAsString in object file_here
var doc = DriveApp.getFolderById('*FOLDER_ID*');
doc.createFile(file).getContentAsString();
Any ideas why? What's the proper way to do this?
答案 0 :(得分:1)
doc.createFile(file).getAs('text/plain').getDataAsString();
or
doc.createFile(file).getBlob().getDataAsString();
https://developers.google.com/apps-script/reference/base/blob