I have sent the image file in a byte array from the server. Now I have to convert that into a jpeg file and display it in a webpage.
Code:
app.get('/getPhoto/:hash',function(req, res){
console.log(req.params.hash);
invoke = require('/Users/sanjeev.natarajan/ipfs/file1.js');
invoke.getfile(req.params.hash).then((str)=>{
console.log("resu",str)
res.send({"Result":str});
})
.catch((error) => {
res.send({"Error":"error in fetching the file through the hashcode"});
})
});
I am receiving the data from the backend; now I need to convert this into an image in angular6