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

use pump(zipStream, writeStream), the zip file at disk is nested one level more #57

Open
WormGirl opened this issue Jun 8, 2022 · 1 comment

Comments

@WormGirl
Copy link

WormGirl commented Jun 8, 2022

for example;
zip file: upload.zip include a foo.json, then upload it use stream, when i get the stream at server. and do this;

 const ctx = this.ctx;
 const stream = await ctx.getFileStream();
 const target = path.join(this.app.baseDir, 'app/upload', 'demo.zip');
 const writeStream = createWriteStream(target);
pump(stream ,writeStream )

the file render at disk actualy is demo.zip inclued upload -> foo.json. if I do this. it will be normal

 const ctx = this.ctx;
 const stream = await ctx.getFileStream();
 const target = path.join(this.app.baseDir, 'app/upload', 'demo.zip');
 const writeStream = createWriteStream(target);
 stream.pipe(writeStream);
 stream.on('finish', () => {
     stream.close();
 })
@mafintosh
Copy link
Owner

Doesn’t sound like a pump issue. Pump just pipes stream together. Maybe the zip thing is using a custom stream impl?

In anycase feel free to send a minimal runnable testcase with as few deps as possible and I’ll take a look

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

2 participants