title: Convert returned file from server in blob and download
body: <p>I am trying to covert returned file from server in blob and download it but I am missing smth. file type could be image, pdf or doc.</p>
  
  <p>this is how file response with looks like</p>
  
  <p><a href="https://i.stack.imgur.com/WzPVM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WzPVM.png" alt="response file"></a></p>
  
  <pre><code>$http.get('url', {
       headers: {'Content-Type': undefined}
  }).then(function (response) {
  
      var blob = new Blob([response.data], { type: 'image' }),
          url = $window.URL || $window.webkitURL;
  
      $scope.fileUrl = url.createObjectURL(blob);
  
  }).catch(function(error) {
  });        
  </code></pre>
  
  <p>what am I doing wrong and this does not work as expected ?</p>