title: How to set 'Content-Disposition' and 'Filename' when using FileSystemResource to force a file download file?
body: <p>What is the most appropriate, and standard, way to set the <code>Content-Disposition=attachment</code> and <code>filename=xyz.zip</code> using Spring 3 <code>FileSystemResource</code>?</p>
  
  <p>The action looks like :</p>
  
  <pre><code>@ResponseBody
  @RequestMapping(value = "/action/{abcd}/{efgh}", method = RequestMethod.GET, produces = "application/zip")
  @PreAuthorize("@authorizationService.authorizeMethod()")
  public FileSystemResource doAction(@PathVariable String abcd, @PathVariable String efgh) {
  
      File zipFile = service.getFile(abcd, efgh);
  
      return new FileSystemResource(zipFile);
  }
  </code></pre>
  
  <p>Although the file is a zip file so the browser always downloads the file, but I would like to explicitly mention the file as attachment, and also provide a filename that has nothing to do with the files actual name.</p>
  
  <p>There might be workarounds for this problem, but I would like to know the proper Spring and <code>FileSystemResource</code> way to achieve this goal.</p>
  
  <p>P.S. The file that is being used here is a temporary file, marked for deletion when the JVM exists.</p>