title: How to download 10GB file with Angularjs, Java, Tomcat,Spring and REST?
body: <p>When I download small file , everything is OK , but I need some way to download large files . If file large, Blob didn't created , haven't enough memory. 
  Download file without save on client , directly save to disk with many requests on the server or something like that. </p>
  
  <p>My code on server is : </p>
  
  <pre><code>@RequestMapping(value = "/oneFile/{name}", method = RequestMethod.GET)
      public void getOneFile( @PathVariable("name") String name, HttpServletResponse response,HttpServletRequest request) {
                  ....
                  InputStream in = new FileInputStream(new File(file.getAbsolutePath()));
                  org.apache.commons.io.IOUtils.copy(in, response.getOutputStream());
                  response.flushBuffer();
  </code></pre>
  
  <p>On client and this is work for small size: </p>
  
  <pre><code>backupFileServer.downloadOneFileBrow(data)
                          .success(function(databack) {
  
                              var file = new Blob([ databack ], {
                                  type : 'application/csv'
                              });
                              var fileURL = URL.createObjectURL(file);
                              var a = document.createElement('a');
                              a.href = fileURL;
                              a.target = '_blank';
                              a.download = data;
                              document.body.appendChild(a);
                              a.click();
                          })
                          .error(function() {
                              alert($scope.DOWNLOAD_ERROR);
                          });
  </code></pre>
  
  <p>I tried something like this but didn't work : </p>
  
  <pre><code>var a = document.createElement('a');
                                 a.href = 'data:attachment/csv;charset=utf-8,' + encodeURI(databack);
                                 a.target = '_blank';
                                 a.download = data;
                                 document.body.appendChild(a);
                                 a.click();
  </code></pre>
  
  <p>How someone idea how to do this or some example or code ....<br>
  Thank you in advance</p>