0

My question is regarding downloading a file from the server to the user's machine using Spring MVC.

Let's say an html or jsp has code which opens a browser file download dialog box for the user to select a folder and filename to save a file from the server. What does the Spring controller need to do to correctly handle this request?

I understand how to map a method to capture the download request, with a mapping like this: @RequestMapping(value="/download-url", method = RequestMethod.GET)

public ModelAndView saveFile(Map model){

My question is, how should the controller extract the file mame and file content from the Model to save it to the local file system?

Any code examples greatly appreciated, especially of saving .csv files (comma delimited) for opening in excel, thanks.

user1052610
  • 4,440
  • 13
  • 50
  • 101
  • Either I'm not understanding correctly or you are very confused about Spring MVC (and web technology in general). Spring MVC executes on the server and has no access to the "local filesystem". – madth3 Jul 08 '12 at 18:04
  • 3
    Possible duplicate - here is one along the same lines - http://stackoverflow.com/q/5673260/204788 – Biju Kunjummen Jul 08 '12 at 21:05

0 Answers0