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

203
Vistas
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
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