可视化文件不下载它minio



我使用Minio来存储文件,我需要在浏览器中可视化其中的一些文件,而不需要下载它们。我使用了这段代码,但不幸的是它下载了文件。

minioClient。getObjectUrl (bucketName ObjectName)

谢谢

关于MinIO文档,我们可以获得存储对象url,为此我使用了这段代码:

// Get presigned URL of an object for HTTP method, expiry time and custom request parameters.
Map<String, String> reqParams = new HashMap<>();
reqParams.put("response-content-type", "application/pdf"); //very helpfull to preview pdf from browser
return minioClient.getPresignedObjectUrl(Method.GET,bucketName,objectName,expiryTime,reqParams);

最新更新