google-apps-script - 在 Google Drive 中创建 blob 时返回 URL
问题描述
我正在使用 MIT App Inventor 2 和 Google Sheets 构建一个应用程序,该应用程序将照片作为错误报告表单的一部分提交到 Drive 文件夹。我已经通过 Tim AI2 的自定义应用程序脚本处理了照片上传位,如下所示:
function doPost(e) {
var data = Utilities.base64Decode(e.parameters.data);
var blob = Utilities.newBlob(data, e.parameters.mimetype, e.parameters.filename);
DriveApp.getFolderById('<YOUR FOLDER ID HERE>').createFile(blob);
return ContentService.createTextOutput("Your File Successfully Uploaded");
}
JavaScript 和我......不是朋友,所以我试图在 blob 生成后抓住它的 URL 并返回它而不是状态。帮助?
解决方案
推荐阅读
- php - move_uploaded_file():copy() 函数的第二个参数不能是目录
- c# - C#使用正则表达式删除行,包括换行
- c++ - 为什么类成员变量调用已删除的复制构造函数,而局部变量调用构造函数?
- sql-server - 在 SSIS 加载期间将 Oracle rowidtochar() 字段评估为 SQL Server nvarchar(18) 字段时遇到问题
- swift - 我可以将成员初始化器添加到符合 Codable 的对象吗?
- sql - 使用查询中的计算字段更新表
- python - 连接熊猫中的字符串列
- git - 我可以删除从 Git Cherry 中挑选的分支吗
- javascript - 删除节点数据时如何在 GoJS 中为删除设置动画?
- c# - 匹配字符串时如何在lambda表达式中选择选择器的属性