Answer the question
In order to leave comments, you need to log in
How to properly configure the server to correctly display the downloaded file with the name in Cyrillic?
Good day to all!
There is a TomCat 7 server, I make it possible to download a file from the server;
The link to download the file looks like this:
<a href="downloadAction.action?struts.enableJSONValidation=true&fileName=тестовый файл.jpeg&fileId=2&fileContentType=null" target="_blank">тестовый файл.jpeg</a>
<Connector URIEncoding="UTF-8" connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
filename*="utf8'ru-ru'${fileName}"
, Answer the question
In order to leave comments, you need to log in
Maybe you should decide on the client side?
davidwalsh.name/download-attribute
<a href="downloadAction.action?struts.enableJSONValidation=true&fileName=тестовый файл.jpeg&fileId=2&fileContentType=null" target="_blank" download="тестовый файл.jpeg">тестовый файл.jpeg</a>
As a result, I did this:
I send the name from the server through URLEncoder, added the parameter to struts filename*="utf8'ru-ru'${fileName}"
.
So FireFox understands the name normally.
More via attribute
downloadI specify the file name in the link, as Chrome understands.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question