dcsimg
Russian characters of a filename in the dialogue to open or to save the file, turn to hieroglyphs. (tomcat apache Myfaces)
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Vladimir_Petrov
Posted On:   Saturday, August 25, 2007 03:33 PM

Hello! I'm from Russia. And I not so well speak in English. i am trying to get the data from database to jsp. If the name of the file on English - in the dialogue normal characters, all works. If the name of the file on Russian - in the dialogue hieroglyphs and nothing works. Please respond. jsp: <%@ page contentType="text/html; charset=UTF-8" %> <%@ page pageEncoding="UTF-8"%> <%@ page import="java.io.File, java.io.InputStream, java.io.FileInputStream, java.io.OutputStream"%> <%@ page session="false" %> <% String fileName = (String)application.getAttribute(&   More>>

Hello!
I'm from Russia. And I not so well speak in English.
i am trying to get the data from database to jsp.
If the name of the file on English - in the dialogue normal characters, all works.
If the name of the file on Russian - in the dialogue hieroglyphs and nothing works.
Please respond.

jsp:

			
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page pageEncoding="UTF-8"%>
<%@ page import="java.io.File,
java.io.InputStream,
java.io.FileInputStream,
java.io.OutputStream"%>
<%@ page session="false" %>
<%
String fileName = (String)application.getAttribute("fileupload_name");
String contentType = (String)application.getAttribute("fileupload_type");
if(contentType!=null){
response.setContentType(contentType);
}

StringBuffer contentDisposition = new StringBuffer();

contentDisposition.append("attachment;");
//URLEncoder.encode(fileName, "UTF-8");
contentDisposition.append("filename="");
contentDisposition.append(fileName);
contentDisposition.append(""");

response.setHeader ("Content-Disposition", contentDisposition.toString());


byte[] bytes = (byte[])application.getAttribute("fileupload_bytes");
if (bytes != null){
response.getOutputStream().write(bytes);
}
%>

Thank by all.    <<Less
About | Sitemap | Contact