You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2004/03/19 09:19:08 UTC

DO NOT REPLY [Bug 27796] New: - apache2/mod_jk/tomcat4 - downloading files with special characters in the filename

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27796>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27796

apache2/mod_jk/tomcat4 - downloading files with special characters in the filename

           Summary: apache2/mod_jk/tomcat4 - downloading files with special
                    characters in the filename
           Product: Tomcat 4
           Version: 4.1.18
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Connector:Coyote JK 2
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: ahartstack@hotmail.com


Problem:
In my tomcat webapp a servlet manages a filedownload. Clicking on a file-link 
results in the browser's 
"save as" dialog (IE6, Netscape7, Firebird0.7, Opera 7). 
Using tomcat alone (port 8080) everything works fine. Special characters (like 
German umlaut) are shown 
in ISO-8859-1.
Apache2/mod_jk seems to change the charset to UTF-8, e.g. "täst.txt" looks 
like "tät.txt".
Apache's default charset is set to ISO-8859-1 (httpd.conf).

Servlet Code:
response.setHeader("Content-Disposition", "attachment; filename=" + file.getName
());
response.setContentLength((int)file.length());
response.setContentType("application/octet-stream");
response.setHeader("Content-Transfer-Encoding", "binary");

Configuration:
- Apache 2.0.48 
- Tomcat 4.1.18 
- mod_jk 4.1.18
- $tomcat_home/bin/catalina.sh:
	export CATALINA_OPTS="-Dfile.encoding=ISO-8859-1 -Duser.language=de -
Duser.country=DE"

Greetings Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org