| | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.constant.UserOperation; |
| | | import com.whyc.dto.FileDirPath; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.ZipUtils; |
| | | import com.whyc.mapper.ProductSoftwareMapper; |
| | |
| | | } |
| | | //根据软件名称实现软件下载 |
| | | public void downLoadSoftware(HttpServletRequest req, HttpServletResponse resp, String softwareName) { |
| | | String fileDirName = FileDirPath.getFileDirName(); |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("software_name",softwareName); |
| | | wrapper.last("limit 1"); |
| | |
| | | resp.addHeader("Content-Disposition", "attachment;filename=" |
| | | + new String(softwareName.getBytes("UTF-8"), "ISO8859-1")); |
| | | OutputStream out = resp.getOutputStream(); |
| | | FileInputStream in = new FileInputStream(software.getSoftwareUrl()); |
| | | FileInputStream in = new FileInputStream(fileDirName+File.separator+software.getSoftwareUrl()); |
| | | int len=0; |
| | | byte[] buffer =new byte[1024]; |
| | | //7. 将缓冲区中的数据输出 |