title: AngularJs get blob with $http.get and extract type from response
body: <p>I have webApi return me a blob file that I have to display.
  how can I know what type is the blob that I got? It could be anything, pdf, doc, jpeg etc.</p>
  
  <pre><code>$http({ method: 'GET', url: (itemsUrl), responseType: 'arraybuffer' }).then(function mySucces(res) {
      var byteArray = res.data;
      byteArray = new Uint8Array(byteArray);
      var file = new Blob([byteArray], { type: '??????' });
      var fileURL = URL.createObjectURL(file);
      window.open(fileURL);
  });
  </code></pre>
  
  <p>or, how can I open blob in a new window without know the file type?</p>