I have a JSP page that handles file uploads.
I set the response header like this:
response.setContentType("application/octet-stream"); response.addHeader("Content-Disposition","attachment; filename="+fileName);
When the file_name contains spaces (ie, โBusiness Report.docโ), the browser dialog box saves the file as โBusinessโ.
I tried using URLEncoder.encode (file_name, "Unicode"); (also tried UTF-8)
but the result is "Business + Report.doc".
I want the end result to be "Business Report.doc"
Any ideas?
Thanks.
source share