Friday, 17 March 2017

How to create blob using the response of url in javascriprt

I have tried creating blob using the following code:

var res = JSON.parse(response); 
var file = new Blob([res.data], {type: res.headers['content-type']});
var fileURL = URL.createObjectURL(file);
console.log(fileURL);

The blob is not created as per the data. eg. for an image it shows empty small image.



via Ritish Gumber

No comments:

Post a Comment