问题
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