spring文件上传下载(文件存存数据库)
FileContent fileContent = contactService.getFileContent(fileContentId);response.reset();//response.addHeader("Content-Disposition", "attachment;filename="+ fileContent.getAttachment().getFileName());response.addHeader("Content-Length", ""+fileContent.getFileContent().length);response.setContentType("bin");OutputStream toClient = new BufferedOutputStream(response.getOutputStream());response.setContentType("application/octet-stream");toClient.write(fileContent.getFileContent());toClient.flush();toClient.close();?
?
?
?
?
?
?
?
?
?
?
?
?