Error: Corrupted zip : can't find end of central directory - XLSX
Error: Corrupted zip : can't find end of central directory - XLSX
我正在尝试使用 XLSX npm 读取我的 excel 文件。虽然将其抛出错误读取为“Corrupted zip : can't find end of central directory'
这是我遇到的错误,
Error: Corrupted zip : can't find end of central directory
at Object.ZipEntries.readEndOfCentral (/Users/.../node_modules/xlsx/jszip.js:2087:27)
at Object.ZipEntries.load (/Users/.../node_modules/xlsx/jszip.js:2104:18)
at Object.ZipEntries (/Users/.../node_modules/xlsx/jszip.js:2010:18)
at Object.JSZip.load (/Users/.../node_modules/xlsx/jszip.js:2115:22)
at Object.JSZip (/Users/.../node_modules/xlsx/jszip.js:5:14)
at Object.readSync [as read] (/Users/.../node_modules/xlsx/xlsx.js:940:24)
为什么会抛出错误,我们正在尝试读取从任何云端或其他地方完全下载的文件。因此,在读取 excel 文件之前,请确保该文件未处于写入模式。文件完全下载后,尝试填充 Excel 数据。
希望它能解决您的问题。
location /uploads {
proxy_pass http://127.0.0.1:5050;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_redirect off;
}
因为我在我的服务器中使用 nginx 设置,所以我只是代理传递了 headers 以便它识别我的文件存储路径并完全取回它。它对我有用!
我正在尝试使用 XLSX npm 读取我的 excel 文件。虽然将其抛出错误读取为“Corrupted zip : can't find end of central directory'
这是我遇到的错误,
Error: Corrupted zip : can't find end of central directory
at Object.ZipEntries.readEndOfCentral (/Users/.../node_modules/xlsx/jszip.js:2087:27)
at Object.ZipEntries.load (/Users/.../node_modules/xlsx/jszip.js:2104:18)
at Object.ZipEntries (/Users/.../node_modules/xlsx/jszip.js:2010:18)
at Object.JSZip.load (/Users/.../node_modules/xlsx/jszip.js:2115:22)
at Object.JSZip (/Users/.../node_modules/xlsx/jszip.js:5:14)
at Object.readSync [as read] (/Users/.../node_modules/xlsx/xlsx.js:940:24)
为什么会抛出错误,我们正在尝试读取从任何云端或其他地方完全下载的文件。因此,在读取 excel 文件之前,请确保该文件未处于写入模式。文件完全下载后,尝试填充 Excel 数据。
希望它能解决您的问题。
location /uploads {
proxy_pass http://127.0.0.1:5050;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_redirect off;
}
因为我在我的服务器中使用 nginx 设置,所以我只是代理传递了 headers 以便它识别我的文件存储路径并完全取回它。它对我有用!