last day (23 days later) » 

5:33 PM
hi
 
hi
 
so what's the error?
 
I want to download a zip archive from my server, but it downloads a broken one (
Maybe because I'm archiving a folder of folders?
 
no,no
I mean in chrome browser
which error did you get?
 
net::ERR_CONTENT_LENGTH_MISMATCH 200 (OK)
And Uncaught (in promise) TypeError: Failed to fetch
 
5:38 PM
please try this

app.post("/download", (req, res) => {
const archive = archiver("zip");
archive.directory("output");
archive.finalize();
res.attachment("ex.zip");
archive.pipe(res);
});
 
hello
did you try my answer?
 
JOB!)
Thank you
 
you're welcome
 
you're welcome
thank you
 
So you made it without my answer ? :o
 
5:44 PM
The code above helped)))
 
and previous error is fixed?
 
oh yes so you chose to pipe the stream without writing it on the disk
that also works
got it now :p
 
All errors are gone) The archive is downloaded)
 
note that you won't have any progress bar when downloading a file while it's being zipped
when you save it on the disk before, the content length is known by the client from the start
and the browser can display an accurate progress bar
 
I'm glad you solved all errors.
 
5:48 PM
without your help I would not have corrected the mistakes :)
 
thank you
see you later
bye
 
bye
Have you been learning React Node for a long time?
 
it directs to me?
If so, yes. I have 7+ years of experience with that frameworks.
 
Both of you) I have a question, I just started studying them a couple of weeks ago. ';' needed on each line? What do they allow you to do?
 
in javascript, ; is not needed
 
6:02 PM
Thank you
 
I guess you are familiar with python?
but to avoid confusion and bugs, I prefer to use them.
 
Yes, I've written python code before.
What could be wrong?
 
huh
No
I mean python doesn't require semicolon - ";" so I think you don't like writing ";"
 
Exactly. Just in C++ without ; a syntax error occurs. And in js it turns out you can use ; and not to use) This confused me.
 

  last day (23 days later) »