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

106
Vistas
Dealing with files and folders with space in data.js

If I try to load images/folders with spaces, I get this error.

message: "ENOENT: no such file or directory, stat 'C:\\Users\\John\\ReactProjects\\my-site\\frontend\\build\\index.html'"

Though it works if I delete spaces but I am not satisfied with this solution.

enter image description here

My project hierarchy

project hierarchy

Edit 1 :

products: [
  {
    name: "Gotham",
    category: "NY",
    image: "/images/Homepage and Store/Gotham.jpg",
    countInStock: 5,
  },
...
]

{products.map((product, index) => (
<img
  className="absolute object-contain w-full h-full"
  src={product.image}
  alt={product.name}
/>
)}

server.js

const app = express();
app.use(express.static(path.join(__dirname, "..", "build")));
app.use(express.static("public"));
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

There is no need to put %20 in the image url in the code. You can freely put there spaces and the browser while requesting the resource will replace them with %20.

URL in the code:

"images/Homepage and Store/Gotham.jpg"

Browser request:

images/Homepage%20and%20Store/Gotham.jpg
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