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

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

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