Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

696
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!