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

197
Views
Display image saved in folder and name in database in Nodejs and Vuejs

Am saving my images into a folder, while the image name is saved in the database. In my backend I already made the upload folder a named static folder

enter image description here

app.use(express.static(path.join(__dirname, 'public')));

So I am trying to get the image in my vuejs code.

 <img class="profile-user-img img-fluid img-circle" :src="getProfilePhoto()" alt="User profile picture">

My Method.

getProfilePhoto() {
  if(this.profiles.file){
    this.profiles.file = this.profiles.file.replace(/^\/+|\/+$/g, '')
    return (`http://localhost:8081/public/images/${this.profiles.file}`)
  }
  console.log(this.profiles.name)
},

But I am getting 404 Not found and undefined. I try to log the image but the result is undefined

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!