I have a JSP page that handles file downloads.
I set the response header like so:
response.setContentType("application/octet-stream");
response.addHeader("Content-Disposition","attachment; filename="+fileName);
When the fileName contains spaces (i.e. "Business Report.doc"), the browser's dialog window saves the file as "Business".
I tried using URLEncoder.encode(fileName, "Unicode"); (also tried UTF-8)
but I get "Business+Report.doc" as the result.
I want the final result to be "Business Report.doc"
Any ideas?
Thanks.