| | |
| | | ProductSoftware software=mapper.selectOne(wrapper); |
| | | try { |
| | | // 转码防止乱码 |
| | | resp.addHeader("Content-Disposition", "attachment;filename=" |
| | | + new String(softwareName.getBytes("UTF-8"), "ISO8859-1")); |
| | | //resp.addHeader("Content-Disposition", "attachment;filename=" + new String(softwareName.getBytes("UTF-8"), "ISO8859-1")); |
| | | resp.setHeader("Content-Disposition", "attachment;filename* = UTF-8''" + new String(softwareName.getBytes("UTF-8"), "ISO8859-1")); |
| | | OutputStream out = resp.getOutputStream(); |
| | | FileInputStream in = new FileInputStream(fileDirName+File.separator+software.getSoftwareUrl()); |
| | | int len=0; |
| | |
| | | String terminalIp=req.getRemoteAddr(); |
| | | logService.recordOperationLog(docUser.getId(),docUser.getName(), UserOperation.TYPE_DOWNLOAD.getType(),new Date(),terminalIp,opreationMsg,operationDetail); |
| | | } |
| | | |
| | | public static void main(String[] args) throws UnsupportedEncodingException { |
| | | String softwareName="散装件.zip"; |
| | | //ISO8859-1 UTF-8 |
| | | System.out.println(new String(softwareName.getBytes("GBK"), "UTF-8")); |
| | | } |
| | | } |