| | |
| | | wrapper.eq("id",id); |
| | | wrapper.last("limit 1"); |
| | | Software software=mapper.selectOne(wrapper); |
| | | |
| | | String filename=software.getFileUrl().substring(software.getFileUrl().lastIndexOf("\\")+1); |
| | | try { |
| | | // 转码防止乱码 |
| | | //resp.addHeader("Content-Disposition", "attachment;filename=" + new String(softwareName.getBytes("UTF-8"), "ISO8859-1")); |
| | | resp.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode ( software.getFileName()+".zip", "utf-8")); |
| | | resp.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode (filename, "utf-8")); |
| | | OutputStream out = resp.getOutputStream(); |
| | | FileInputStream in = new FileInputStream(fileDirName+File.separator+software.getFileUrl()); |
| | | int len=0; |
| | |
| | | int flag=mapper.update(null,uwrapper); |
| | | return new Response().set(1,flag>0,"锁定/解锁成功"); |
| | | } |
| | | |
| | | } |