Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unzip xls should use buffer instead of string #62

Open
yujiang opened this issue Dec 29, 2018 · 0 comments
Open

Unzip xls should use buffer instead of string #62

yujiang opened this issue Dec 29, 2018 · 0 comments

Comments

@yujiang
Copy link

yujiang commented Dec 29, 2018

Unzip xlsx should use buffer instead of string , or there will be error when unzip large chinese xlsx

function extractFiles(path, sheet) {
...
.on('entry', function (entry) {
var file = files[entry.path];
if (file) {
//let contents = '';
let buffer = new Buffer("");
filePromises.push(new Promise((resolve) => {
entry
//.on('data', data => contents += data.toString())
.on('data', (data) => {
buffer = Buffer.concat([buffer,data])
})
.on('end', () => {
//files[file].contents = contents;
files[file].contents = buffer.toString();
resolve();
});
}));
} else {
entry.autodrain();
}
});
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant