title: Receive zip file, angularJs
body: <p>I've got a problem when I want to download a zip file from a Rest api, </p>
  
  <p>When the zip file is tranfered from my server (with jersey), I receive it corrupted, ...</p>
  
  <p>I've already tried to put <code>responseType: 'arraybuffer'</code> on my $http request but it isn't fixing anything... here's my code.</p>
  
  <pre><code>$http.get(uploadUrl, {
             cache: false,
             responseType: 'arraybuffer'
        })
       .success(function (data, $scope) {
           var element = angular.element('&lt;a/&gt;');
           console.debug("data : " + data);
           element.attr({
               href: 'data:application/octet-stream;charset=utf-8,' + encodeURI(data),
               target: '_blank',
               download: fileName
           })[0].click();
        })
       .error(function () {
          console.info("fail on download");
        });
  };
  </code></pre>