I have a server side application that will return an image. These are the response headers:
Content-Disposition: attachment; filename=8822a009-944e-43f4-999b-d297198d302a;1.0_low-res
Content-Length: 502343
Content-Type: image/png
Date: Mon, 03 Aug 2015 19:13:39 GMT
Server: Apache-Coyote/1.1
In angular, I need to display the image. When getting the image, I use the angularJS $http
to call the server and put the result in scope, but I never reach the success function of $http
. Executing this call from postman returns the image normally. I'm curious to how to get Angular to display the image.
This is how I display the image:
<img ng-src={{image}} />
Here is the call to get the image from the server:
$http.get(url, {responseType: "arraybuffer"})
.success(function(data) {
$scope.image= data;
}
)