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

697
Vistas
How can I convert .xls to .xlsx using a nodejs library?

I'm having trouble reading a .xls file using the ExcelJS library. No problems reading .xlsx files. I used to use only the xlsx js library and did not have any issues reading .xls files.

I was under the impression ExcelJS included xlsx library so my assumption was that reading .xls would work as expected.

So my question is...can I convert .xls to .xlsx using exceljs (I cannot require a user to convert the file themselves in excel) or can I somehow implement the unzip from xlsx js library and incorporate it in the exceljs source code to make it possible?

I switched to exceljs because it seemed more straightforward when it comes to creating excel files.

Thanks All

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I found a workaround, you can try converting the xls file to CSV with xlsx library and read CSV with ExcelJS.

It doesn't seem to supports converting from xls to xlsx, but if you don't mind forcing users to upload xls file, save the xlsx file and upload it again then here is my codepen for that

        document.getElementById('my_upload').addEventListener('change', function(e) {
            var file = e.target.files[0];
            var reader = new FileReader();
            reader.onload = function(e) {
                var data = e.target.result;
                var workbook = XLSX.read(data, {
                    type: 'binary'
                });
                XLSX.writeFile(workbook, 'test.xlsx');
            };
            reader.readAsBinaryString(file);
        });
about 4 years ago · Juan Pablo Isaza 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