首页 > 解决方案 > 在 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 并返回而不是状态。帮助?

标签: google-apps-scriptgoogle-drive-apiblobapp-inventorgeturl

解决方案


推荐阅读