Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

178
Visualizações
Convert application/json to blob

My backend schema for portfolio is array of type String that contains the path of the images.

enter image description here

I even tried:

  portfolio: {
    type: [String],
  },

gave same result.

and its response looks something like this (notice it's array of paths)

enter image description here

this is how my axios.get looks like,

enter image description here

if i use the responseType: blob, it gives back object like this

enter image description here

this is affecting the my process of displaying array of paths that i have, convert them into blob to be able to display them on frontend

even though i tried to manually convert the blobs into array again (the for loop in my code), it looks like this now, but still unable to load the files

enter image description here

this is how they look like on frontend enter image description here

UPDATE

tried with fetch request instead of Axios but instead the response looked something like this

enter image description here

and the blob: is basically merged blob of the three images that I have under portfolio, which is definitely not what i want, i want a blob of the three images separately

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

First of all store the images in the server public directory which you can access via the public URL of that image. Then you send the path of the image relative to the public directory of your server. After getting the response from the server to via Axios just put the URL in the src of the image tag.

For example, suppose your server's public directory is /public and you store an image in it named image.png. Your Axios request must return the response like portfolio:["/image.png", ...]. So just put the image url in the tag it will works fine.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda