This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Error in Attachment file name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Error in Attachment file name" Watch "Error in Attachment file name" New topic

Error in Attachment file name

jim jjoh

Joined: May 02, 2011
Posts: 5
Hi below is my code

String fileName="XxxxxxxXxx_Sxxxxxxs.xls";(not real)
response.setHeader("Content-Disposition", "attachment; filename="+fileName);

In IE7 the file name is getting appended with some junk charaters.
For IE8 and Firefox it is working correctly.
Did anybody know the reason?

From the trial and error method what I understand is β€˜_S β€˜is causing the problem.
If we change β€˜_S’ to some other letters or append another letter in the end of filename this issue is not coming.

Is there any work around for this?Did anybody knows the reason for this?

I agree. Here's the link:
subject: Error in Attachment file name
Similar Threads
Urgent(Attachment opening inNetscape 6.2)
EMail attachment File Name: HOW TO?
Download the .lzh file with prompting file save dialog
how to add -Dfile.encoding=UTF-8
Getting attachment filename with special characters(JAVA MAIL API)