From 9cb38c3cd0203bf6ab1a6b42b496717221d6e8cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E8=88=92=E6=89=AC?= Date: Thu, 4 Jun 2026 09:48:33 +0800 Subject: [PATCH] fix: add 'folder' param to Cloudinary upload options The plugin was only passing 'public_id' with the full path (e.g. 'my-website/test/md5hash'), which caused all uploaded images to appear under 'Home' in Cloudinary's Media Library Browser view, ignoring the user-configured folder. Fix by passing the path as the 'folder' parameter and the hash as the 'public_id' separately, so Cloudinary properly organizes assets into the specified folder in its Media Library. --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index a4e5a18..c5bb8fc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -37,7 +37,8 @@ const handle = async (ctx: picgo)=>{ }); const options = { //'use_filename' : true, - 'public_id' : fPath + '/' + hashfName, + 'folder' : fPath, + 'public_id' : hashfName, 'unique_filename': false } await cloudinary.uploader.upload(img, options ,function(error, result) {