gpt4 book ai didi

javascript - 气体 : "InternalError: Array length exceeds supported capacity limit."

转载 作者:行者123 更新时间:2023-12-01 01:39:43 25 4
gpt4 key购买 nike

我正在向 Amazon S3 服务器运行 URLFetchApp 请求,以提取音频文件并将其重新定位到 Google 云端硬盘。 HTTPResponse 以 XML 格式返回。

我运行以下代码来转换为可以存储在 Google 云端硬盘中的可用 blob:

/*driveAppFolder, fileName, response are pre-defined variables from earlier in the program*/

var responseBlob = response.getBlob();
var driveAppFile = driveAppFolder.createFile(blob).setName(fileName);

此代码在达到一定大小时可以完美运行。我还没有弄清楚限制,但我知道 50MB 文件(52657324 字节)将阻止 blob 生成并出现错误:

InternalError: Array length 52389150 exceeds supported capacity limit. 

我意识到处理了类似的 JavaScript 错误 here ,但我目前被锁定在 Google Apps 脚本的范围内。有没有办法可以解决这种限制并制作 Blob ?

最佳答案

这个答案怎么样? 50 MB 是 52,428,800 字节。在 Google Apps 脚本中,blob 的大小存在限制。最大大小为 52,428,800 字节。所以在你的情况下,会发生这样的错误。在您的情况下,您下载了这么大的文件。当你下载的时候,使用下面的方法怎么样?

  1. 范围使用部分下载。
  2. 使用库从 URL 下载大文件。
    • 该库使用部分下载。

引用文献:

关于javascript - 气体 : "InternalError: Array length exceeds supported capacity limit.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52525797/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com