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

95
Views
How to read 'Resource Object image from java backend' in javascript, html

A Backend return Resource object.

public ResponseEntity<?> returnImage(String imgFilePath) {

     Resource resource = new FileSystemResource(imagFilePath);

     HttpHeaders header = new HttpHeaders();
     Path path = Paths.get(imageFilePath);
     header.add("Content-Type", Files.probeContentType(path);

     return new ResponseEntity<Resource>(resource, header, HttpStatus.OK);

}

When I fetch image data from backend, response had a string data... Why not response have 'File Object'?

Response console log

I want to read this response and render this file on browser by img tag. I think this string is neither base64 nor dataUrl ... How can i read it and render on browser?

A Postman show image as response body...

postman example

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!