I have a Blob of an image that I am trying to display in the browser. However, when I use the code below to open the image, it shows some Mandarin scripts on the window.
Here is the code snippet:
var url="http://....link..../downloadFile?fdsFileId="+fileId;
$http({
method: 'GET',
url: url,
responseType: 'arraybuffer'
}).success(function (data, status, headers) {
headers = headers();
var contentType = headers['content-type'];
var blob = new Blob([data], { type: contentType });
var fileURL = window.URL.createObjectURL(blob);
console.log("url:"+fileURL);
console.log("content type:"+contentType);
window.open(fileURL);
window.URL.revokeObjectURL(fileURL);
After executing the code, the image displayed in the browser is as follows: The fileURL containing the image is provided for viewing.