google-apps-script - 如何将 Google Apps 脚本 blob 转换为 base64 编码的字符串?

标签 google-apps-script

我在 Google Apps 脚本中有一个 blob。如何将其转换为 base64 编码的字符串以便将其写入其他 API? FileReader 似乎不起作用...

最佳答案

你可以试试这个:

Utilities.base64Encode(blob.getBytes());

Ref docs here .

关于google-apps-script - 如何将 Google Apps 脚本 blob 转换为 base64 编码的字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57418118/

相关文章:

javascript - 成功登录 firebase 后,Google Apps 脚本重定向到 HTML 文件

google-apps-script - 如何关闭对话框

google-apps-script - Google API 返回响应 200 空 JSON

google-apps-script - 谷歌脚本 : "Your input contains more than the maximum of 50000 characters in a single cell"

google-apps-script - 当事件电子表格更改时调用事件

javascript - 生成的 HTML 与 JSON、Google Apps 脚本

java - 与在 Eclipse 中使用常规 Java 代码相比,使用 Google Apps 脚本与 Google 表格交互有哪些优势?

google-apps-script - 应用程序脚本 - 电子表格到 Gmail "Invalid Email <>"错误

google-apps-script - Google 脚本 - 将文件名与文件夹名称进行比较,如果名称匹配,则将文件移动到文件夹中

javascript - 将 Excel BLOB 转换为 javascript 数组