Is there a size limit to a blob for Utilities.unzip(blob) in Google Apps Script?

穿精又带淫゛_ 提交于 2019-12-12 04:03:00

问题


I have a google script which accesses a website, finds a .zip file, unzips it, and extracts the relevant data from the relevant files.

I want to do the same thing, but for a different, larger .zip file on the same site.

I've accessed the .zip (using almost identical code), but it throws an error: "Could not unzip."

My code:

  var dir = UrlFetchApp.fetch(url);
  var b = dir.getBlob();
  var files = Utilities.unzip(b);

The only difference between the two files are these:

  • File A ends with "Update%201.8.5.zip" and contains 9 files (5.46MB, 5.15MB zipped)
  • File B ends with "260_185.zip" and contains 407 files (384MB, 280MB zipped)

This makes me think that there is a limit (size or number of files) to the Utilities.unzip() method. Can anyone confirm this, or is there something with the format of the filenames that is messing things up?


回答1:


Quotas for Google Services include the restriction

URL Fetch data received: 100MB / day

so it seems your URL request could not actually produce a valid zip file.




回答2:


Besides the URL Fetch limits, Utilities.unzip(blob) has its own undisclosed limits.

I just tried to unzip a >200MB file that I get by using DriveApp.getFileById(id) and it returned

El archivo contratacionesabiertas_bulk.csv.zip supera el tamaño de archivo máximo permitido.

(Translation by Google Translate)

The contratacionesabiertas_bulk.csv.zip file exceeds the maximum file size allowed.



来源:https://stackoverflow.com/questions/45830261/is-there-a-size-limit-to-a-blob-for-utilities-unzipblob-in-google-apps-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!