Try the following if you are trying to read the following in a servlet: String s = java.net.URLDecoder.decode( "http://localhost/tomcat-docs/acentua%C3%A7%C3%A3o.txt", "UTF-8" );
You can read the file and write it out to the response stream. Since this is a text file it will be displayed in the browser window. The user may then save the file from the browser. Robert S. Harper Information Access Technology, Inc. -----Original Message----- From: Roberto Rios [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 28, 2005 7:49 AM To: 'Tomcat Users List' Subject: Problems serving files to download Hi, I have a tomcat 4.1.31 (j2sdk1.4.2_08) running in a linux rh9 box. It's a fresh install. I'm from Brazil, so I've configured my linux to use pt_BR.ISO-8859-1. If I type locale, everything is ok. My CATALINA_OPTS has the "-Dfile.encoding=ISO-8859-1" I have no problems with my applications. Everithing works fine. All my pages are compiled fine, my servlets work fine, etc... But, if I try to serve files to download, and this files had special characters like çãí....etc, when I click the file name (that is displayed right), I receive the 404 HTTP error. For instance: using vi, I created a file named "acentuação.txt" inside the tomcat-docs directory. When I try to access this file, it's name is encoded to "acentua%C3%A7%C3%A3o.txt" (the address shows <http://localhost/tomcat-docs/acentua%C3%A7%C3%A3o.txt> http://localhost/tomcat-docs/acentua%C3%A7%C3%A3o.txt), and after that I can't access it. I tryed to use Firefox (1.0.4) and IE 6, but I got the same problem How do I manage this? Who encoded the name? TIA, Bob --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
