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.