From 583dd11df24a42cd007d4d910fb560995ab747fd Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Tue, 22 Oct 2024 09:36:04 +0700 Subject: [PATCH] feat(minio): add get presigned function --- src/utils/minio.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/minio.ts b/src/utils/minio.ts index 55ed921..7d80569 100644 --- a/src/utils/minio.ts +++ b/src/utils/minio.ts @@ -18,6 +18,10 @@ export async function listFile(path: string) { }); } +export async function getPresigned(method: string, path: string, exp = 60 * 60) { + return await minio.presignedUrl(method, MINIO_BUCKET, path, exp); +} + export async function getFile(path: string, exp = 60 * 60) { return await minio.presignedGetObject(MINIO_BUCKET, path, exp); }