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

中文文件名下载

parent d1704029
...@@ -74,7 +74,7 @@ public class FileSystemContorller { ...@@ -74,7 +74,7 @@ public class FileSystemContorller {
String path = id; String path = id;
response.setContentType("text/html; charset = UTF-8"); response.setContentType("text/html; charset = UTF-8");
FileItem fileItem = fileService.loadFileItemByPath(path); 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()); fileItem.copy(response.getOutputStream());
if(fileItem.isTemp()) { if(fileItem.isTemp()) {
fileItem.delete(); fileItem.delete();
...@@ -91,7 +91,7 @@ public class FileSystemContorller { ...@@ -91,7 +91,7 @@ public class FileSystemContorller {
start1 = start2; start1 = start2;
} }
String file = path.substring(start1+1); 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); InputStream input = Thread.currentThread().getContextClassLoader().getResourceAsStream("excelTemplates/"+path);
FileUtil.copy(input, response.getOutputStream()); FileUtil.copy(input, response.getOutputStream());
return null; return null;
......
...@@ -231,6 +231,7 @@ var Lib = { ...@@ -231,6 +231,7 @@ var Lib = {
}, },
download:function(fileId){ download:function(fileId){
fileId=encodeURIComponent(fileId);
window.location.href = Common.ctxPath+"/core/file/get.do?id="+fileId window.location.href = Common.ctxPath+"/core/file/get.do?id="+fileId
}, },
......
...@@ -45,9 +45,11 @@ ...@@ -45,9 +45,11 @@
</script> </script>
<style> <style>
.site-block{padding: 20px; border: 1px solid #eee;} .site-block{padding: 20px; border: 1px solid #eee;}
input{background-color:expression((this.readOnly && this.readOnly == true)? "#efefef":"");}
input[readonly]{
background-color: #efefef; .input-readonly{
background-color: #efefef;
cursor:not-allowed;
} }
</style> </style>
</head> </head>
......
...@@ -18,9 +18,9 @@ if(has(readonly)){ ...@@ -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}" <input type="hidden" name="${name}"
class="layui-input" value="${expected}"></input> value="${expected}"></input>
<!--#}else{ --> <!--#}else{ -->
<select data-group="${group!}" name="${name}" ${has(id)?("id="+id):''}> <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