Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

199
Vistas
tar file extraction nodejs npm

I am trying to extract a tar file, that I will receive from the web-browser client onto a SUSE server. I have installed tar.gz npm for doing my stuff. But it always throws the same error. Below is the function.

function extract(){
    var name = "C:\\MyDrive\\parsing\\1.zip";
    targz().extract(name, 'C:\\MyDrive', function(err){
    if(err)
        console.log('Something is wrong ', err.stack);
    console.log('Job done!');
    });
}

Below is the error.

\root\server>node test.js
Something is wrong  Error: incorrect header check
    at Zlib._handle.onerror (zlib.js:370:17)
Job done!

Well this error is coming even in Windows also. When I create a tar file in windows and extract the same tar file in windows with the same function above. I believe either I am not using the npm currectly.

Is their any other npm and a working sample code for the same, which can extract the tar file uploaded by client. Extraction need to be achieved through some nodejs npm in javascript.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

There are few many modules for zipping and unzipping in node.js here this could be helpful - unzip

fs.createReadStream(name).pipe(unzip.Extract({ path: '/home/outputpath' }));
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda