0

In Java REST API:-

response.setContentType("application/oct-stream"); response.setHeader("Content-Disposition", "inline; filename=\""file.zip\"");

If I receive the response in angularjs $http service, how can I make it downloadable. If only content was returned from Java APi, downloading in javascript is achievable. But how to work with it when a complete file is returned.

  • Maybe you could take a look to other questions like [this one](http://stackoverflow.com/questions/25490007/angularjs-download-pdf-file-from-the-server) – lrnzcig Mar 24 '16 at 14:38
  • Thank you so much. It worked. An addition to it- set {responseType:'arraybuffer'} while making $http.get request so that downloaded zip file is not corrupted. – Tickle Monster Mar 30 '16 at 11:54

0 Answers0