Questions tagged [node-archiver]

node based file and directory archiving with streaming interface, modular plugins can enable other archive formats to be written simply.

node based file and directory archiving with streaming interface, modular plugins can enable other archive formats to be written simply. For more details checkout on the github repository at https://github.com/archiverjs/node-archiver

42 questions
9
votes
3 answers

node-archiver: Archive multiple directories

Is it possible to archive multiple directories when you know their paths? Let's say: ['/dir1','dir2', .., 'dirX']. What I am doing now, is to copying directories in a single directory, let's say: /dirToZip and do the following: var archive =…
sstauross
  • 2,602
  • 2
  • 30
  • 50
8
votes
1 answer

Cloud Function response stream

I have a script that is building a zip file on demand. It's working great locally using the Cloud Functions Local Emulator. When deployed, it's not streaming the response. The whole zip response is built, then sent. I know this is happening…
Adam
  • 655
  • 1
  • 6
  • 19
6
votes
0 answers

Sending Zip file from server to client browser with Express and Archiver

I am a beginner with Node and I am trying to figure out how to create a zip file at the server then send it to the client and then download the zip file to the user's browser. I am using the Express framework and I am using Archiver to actually do…
user1893354
  • 5,778
  • 12
  • 46
  • 83
5
votes
2 answers

Correct headers, but Chrome says "Resource interpreted as Document"

I read a lot of questions like this one, but I really can't figure it out... I use the archiver and express Node.js modules. I want to simply send a zip file to the client. My code looks roughly like this: res.set("Content-Type",…
dodov
  • 5,206
  • 3
  • 34
  • 65
3
votes
1 answer

Can't unzip file generated by node-archiver on OSx

I'm generating a compressed file based on JSON data. Currently, when I generate a TAR file, my API works just fine. Here's my code: app.post('/', (req, res) => { const filename = 'export.tar'; const archive = archiver('tar', {}); …
Cassidy
  • 3,328
  • 5
  • 39
  • 76
3
votes
1 answer

How do I password protect a zip file in Nodejs?

I am creating a zip file using archiver. below is my code to do it. I need to password protect it. How can I do it? var head={'Content-Type':'application/octet-stream','Content-disposition':'attachment;…
user3677779
  • 41
  • 1
  • 4
2
votes
2 answers

Download files, archive and transfer to S3 using streams

I'm using the code from this question to archive files using node-archiver and transfer them to S3. My specific task requires me to download a large number of files from URLs, zip them to one archive, and transfer them to S3. I'm using the "got"…
Alexander
  • 109
  • 1
  • 2
  • 14
2
votes
0 answers

how to calculate node archiver contentlength

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…
suman
  • 21
  • 3
2
votes
0 answers

Node JS - How to view progress when using Archiver (zip)

I already searched on the Web and I finded solutions using "entries". But this solution is not fit when you have (for example) a very big file in folder containing may files. The progress seams to be stopped while processing of the big file. I…
Juan
  • 690
  • 4
  • 15
2
votes
0 answers

archiver.js memory leak inside aws lambda

I'm using archiver to zip a few files in aws lambda. I see that when there is no more disk space to write, archiver still holds(or leaks) some data. I've been trying to do 'archive.close()' or 'archive.destroy()' but I keep getting…
Novice
  • 423
  • 1
  • 9
  • 17
2
votes
0 answers

Node Archiver 'Headers Error' when unzipping large files (above 4GB)

I'm getting Headers Error when downloading files bigger than 4GB, with or without the 'forceZip64' option. The zip is generated on the go when streaming each file content one by one. How zip file is created // create zip archive const zip =…
Arnautg
  • 661
  • 6
  • 10
2
votes
1 answer

Creating zip using express and archiver

I used the node-archiver to zip files as follows. But I get corrupted zip file. app.get('/download', async (req, res) => { const arch = archiver('zip'); arch.append('abc', { name: 'abc.txt'}); arch.append('cdf', { name: 'cdf.txt'}); …
Pavan Kumar
  • 1,715
  • 1
  • 24
  • 48
2
votes
1 answer

Get the size of the output zip file using NodeJs

I'm using NodeJs (expressJs) and archiver module to stream zip file to the client, so the final ZIP file do not existe in server storage (streaming zip serving), but the probleme is that i can't get the size of the output file because the zip…
AHmedRef
  • 2,555
  • 12
  • 43
  • 75
2
votes
0 answers

Permissions issue using node-archiver

When I use archiverjs I cannot open the resulting zip file: var archive = archiver('zip'); var output = fs.createWriteStream(projectName + '.zip'); archive.pipe(output); archive.on('error', function(err) { throw err; }); …
dopatraman
  • 13,416
  • 29
  • 90
  • 154
2
votes
1 answer

Node.js and Requestjs: Pipe a Transform stream to Request.js as a file for upload

I am creating a zip file on memory using node-archiver ( https://github.com/archiverjs/node-archiver ). Using archiver's pipe feature, I pipe everything to a Transform stream. I can pipe this stream to a file if needed, but I would like to let…
noderman
  • 1,934
  • 1
  • 20
  • 36
1
2 3