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

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

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 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!