//minio多文件批量压缩下载
@GetMapping("minioDownload")
public void downloadFile(@RequestParam("filename") List<String> filename,String zip, HttpServletResponse httpResponse) {
try {
BufferedOutputStream bos = null;
httpResponse.reset();
bos = new BufferedOutputStream(httpResponse.getOutputStream());
ZipOutputStream out = new ZipOutputStream(bos);
MinioClient minioClient = new MinioClient(ENDPOINT, ACCESSKEY, SECRETKEY);
for (int i=0;i<filename.size();i++) {
InputStream object = minioClient.getObject(BUCKETNAME, filename.get(i));
byte buf[] = new byte[1024];
int length = 0;
httpResponse.setHeader("Content-Disposition", "attachment;filename=" + zip + ".zip");
httpResponse.setContentType("application/x-msdownload&
springboot+vue+minio批量下载
最新推荐文章于 2024-06-01 17:13:14 发布