title: convert byte array to image in angular6
body: <p>I have sent the image file in a byte array from the server.  Now I have to convert that into a <code>jpeg</code> file and display it in a webpage.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><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)=&gt;{
          console.log("resu",str)
  
          res.send({"Result":str});
      })
      .catch((error) =&gt; {
          res.send({"Error":"error in fetching the file through the hashcode"});
      })    
  });
  </code></pre>
  
  <p>I am receiving the data from the backend; now I need to convert this into an image in angular6</p>