DriveApp.getFolderById :找不到具有给定 ID 的项目,或者您没有访问它的权限



抱歉,又卡住了。我有一个 driveapp 文件 ID 和文件夹 ID。我确信一切都正确。尝试仅将 FileID 移动到文件夹 ID(服务器端脚本(中:

function moveFiles(sourceFileId, targetFolderId, role) {
var file = DriveApp.getFileById(sourceFileId);   
file.getParents().next().removeFile(file);
DriveApp.getFolderById(targetFolderId).addFile(file);
return "1";
}

崩溃的行是DriveApp.getFolderById()行,上面有错误消息(No item with the given ID could be found, or you do not have permission to access it(

这些是我使用我的帐户拥有的文件和文件夹。 我看不出这将是权限问题

我的错误...

我使用的是getUrl()而不是getId()...我的坏

相关内容

最新更新