Commit 163be433 authored by 李家智's avatar 李家智
Browse files

中文文件名下载

parent d1704029
......@@ -74,7 +74,7 @@ public class FileSystemContorller {
String path = id;
response.setContentType("text/html; charset = UTF-8");
FileItem fileItem = fileService.loadFileItemByPath(path);
response.setHeader("Content-Disposition", "attachment; filename="+fileItem.getName());
response.setHeader("Content-Disposition", "attachment; filename="+java.net.URLEncoder.encode(fileItem.getName(), "UTF-8"));
fileItem.copy(response.getOutputStream());
if(fileItem.isTemp()) {
fileItem.delete();
......@@ -91,7 +91,7 @@ public class FileSystemContorller {
start1 = start2;
}
String file = path.substring(start1+1);
response.setHeader("Content-Disposition", "attachment; filename="+file);
response.setHeader("Content-Disposition", "attachment; filename="+java.net.URLEncoder.encode(file,"UTF-8"));
InputStream input = Thread.currentThread().getContextClassLoader().getResourceAsStream("excelTemplates/"+path);
FileUtil.copy(input, response.getOutputStream());
return null;
......
......@@ -231,6 +231,7 @@ var Lib = {
},
download:function(fileId){
fileId=encodeURIComponent(fileId);
window.location.href = Common.ctxPath+"/core/file/get.do?id="+fileId
},
......
......@@ -45,9 +45,11 @@
</script>
<style>
.site-block{padding: 20px; border: 1px solid #eee;}
input{background-color:expression((this.readOnly && this.readOnly == true)? "#efefef":"");}
input[readonly]{
.input-readonly{
background-color: #efefef;
cursor:not-allowed;
}
</style>
</head>
......
......@@ -18,9 +18,9 @@ if(has(readonly)){
}
}
-->
<input type="text" class="layui-input" readonly value="${selectedDict.name}"></input>
<input type="text" class="layui-input input-readonly" value="${selectedDict.name}"></input>
<input type="hidden" name="${name}"
class="layui-input" value="${expected}"></input>
value="${expected}"></input>
<!--#}else{ -->
<select data-group="${group!}" name="${name}" ${has(id)?("id="+id):''}>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment