|
@@ -81,4 +81,15 @@ public class MinioController {
|
|
FileUtil.downloadForHttp(fileName, inputStream, response, 1024);
|
|
FileUtil.downloadForHttp(fileName, inputStream, response, 1024);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @RequestMapping("/preview")
|
|
|
|
+ public void preview(@RequestParam("objectName") String objectName, HttpServletResponse response ) throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException {
|
|
|
|
+ InputStream inputStream = MinioUtil.downloadToStream(
|
|
|
|
+ minioClient,
|
|
|
|
+ bucketName,
|
|
|
|
+ objectName
|
|
|
|
+ );
|
|
|
|
+ String fileName = FileUtil.getFileName(objectName);
|
|
|
|
+ FileUtil.downloadForHttp(fileName, inputStream, response, 1024);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|