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

261
Views
img tag not displaying images when using with ejs

I'm working with express, ejs and mongoose . i have list of products in mongoDB and i want to display images of products which is store in my local storage. i used express.static method to access images. my images named like this SAMSUNG Galaxy M33 5G (Emarld Brown, 128 GB) (6 GB RAM) , i saved their name in an array ( like object ) called category. my code is following

    <% for( list of category){ %> 
        <ul>
            <img src="/<%=list.name%>.jpeg" alt="<%=list.name %>">
            <li><%= list.name %> </li>
        </ul>
     <% } %>

in this case no image is displayed but when i removed brackets () from the name of image ( like this SAMSUNG Galaxy M33 5G Emarld Brown, 128 GB 6 GB RAM ) it start working like wonder but i have so many images and i cant change name of all images please help me to solve this problem

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!