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

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