how to calculate node archiver contentlength

180 Views Asked by At

I am using archiver lib to zip files on fly and send the zip stream directly to the client browser, it's working but, one problem - it's not showing progress, as I am not providing the content- length. How can I calculate content-length before hand ? In my case the length of files are known, but the final archive's size is more than the sum of all files. It is so because there are folders in my archive. So how can I calculate folder size separately? so that I can use - FilesSize + FoldesrSize = Contentlength. I have chosen compression as Store.

0

There are 0 best solutions below