|
|
|
Работа с файлами в J2EE(2)
|
|||
|---|---|---|---|
|
#18+
Есть J2EE приложение использующее поле BLOB c doc файлами на MYSQL. Файлы с именем на английском записываются и открываются в лет. Ели буквы в имени файла русские, то в диалоге на клиенте open or save в имени файла каракули и не чего не работает. В debug все русские буквы нормальные. pageEncoding="UTF-8" <%@page contentType="text/html"%> <%@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"); response.setContentType(contentType); StringBuffer contentDisposition = new StringBuffer(); contentDisposition.append("attachment;"); 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); } %> ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 23.08.2007, 15:23:32 |
|
||
|
|

start [/forum/topic.php?desktop=1&fid=59&tid=2144823]: |
0ms |
get settings: |
15ms |
get forum list: |
23ms |
check forum access: |
5ms |
check topic access: |
5ms |
track hit: |
54ms |
get topic data: |
18ms |
get forum data: |
5ms |
get page messages: |
67ms |
get tp. blocked users: |
2ms |
| others: | 323ms |
| total: | 517ms |

| 0 / 0 |
