I have this piece of code:
resp.addHeader("Content-Disposition", "inline; filename=" + fileName);
When the file name is "a_b_c.doc" or "abc.doc" the name of the downloaded file is displayed correctly. However, when the file name is "a b c .doc" the name of the downloaded file is only "a".
How can we solve this?
Use quotes:
resp.addHeader("Content-Disposition", "inline; filename=\"" + fileName + "\"");