| | |
| | | |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | FileUtils.setAttachmentResponseHeader(response, realFileName); |
| | | FileUtils.writeBytes(filePath, response.getOutputStream()); |
| | | FileUtils.writeToStream(filePath, response.getOutputStream()); |
| | | if (delete) |
| | | { |
| | | FileUtils.deleteFile(filePath); |
| | | FileUtils.del(filePath); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | |
| | | String downloadName = StrUtil.subAfter(downloadPath, "/",true); |
| | | response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); |
| | | FileUtils.setAttachmentResponseHeader(response, downloadName); |
| | | FileUtils.writeBytes(downloadPath, response.getOutputStream()); |
| | | FileUtils.writeToStream(downloadPath, response.getOutputStream()); |
| | | } |
| | | catch (Exception e) |
| | | { |