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

201
Views
Reading excel file in react js electron project

Totally lost here. Tried many different things, but nothing worked. I have a react js electron project, where i need to use some data from excel file. I installed xlsx module. However, got stuck when trying to read file from the component. It works well when I upload the file. But i need file to be in the folder. File is located in folder called "files", the file name is "rent.xlsx" Component is in the same folder as "files" folder, so path should be "./files/rent.xlsx" However, it doesnt read file. Here is the code:

const workbook = XLSX.read("/files/rent.xlsx", { type: "array" });
const sheetName = workbook.SheetNames[0];
const worksheet = workbook.Sheets[sheetName];
const json: any = XLSX.utils.sheet_to_json(worksheet)

As i have mentioned, reading from uploaded file works well. So, code is OK. This part must be wrong:

XLSX.read("/files/rent.xlsx", { type: "array" });

Please, advise what should i do? Am i missing some libraries or modules? Been looking on stackoverflow, but didnt find anything Thanks!

about 4 years ago · Juan Pablo Isaza
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!