Firefox and Chrome are appending underscores before and after the file name while Internet Explorer is working fine.
Firefox and Chrome give: _Warrant_Amendment_5485_14_March_2014.pdf.pdf_
IE gives: Warrant_Amendment_5485_14_March_2014.pdf.pdf
Below is the code
response.setContentType("application/pdf");
response.setHeader("Content-Disposition", "inline;filename=\" + fileName + ".pdf\");
I resolved a similar issue by removing the quotes from the filename value (which in my case were not required).
I note that rfc6266 says a quoted-string for the filename value should be acceptable. At this point I have not investigated further.
I've just faced the same problem and solved it thanks to user650881's reply.
The problem was I had this:
response.addHeader("Content-Disposition","attachment; filename=" + filename + "\"");
And worked when I changed it to this:
response.addHeader("Content-Disposition","attachment; filename=\"" + filename + "\"");
Note the \"" after filename=
Hope it helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With