Skip to content

fix: add 'folder' param to Cloudinary upload options#1

Open
tsy-fred wants to merge 1 commit into
yabostone:mainfrom
tsy-fred:main
Open

fix: add 'folder' param to Cloudinary upload options#1
tsy-fred wants to merge 1 commit into
yabostone:mainfrom
tsy-fred:main

Conversation

@tsy-fred

@tsy-fred tsy-fred commented Jun 4, 2026

Copy link
Copy Markdown

Description

When using the folder config (aka uploadPath), the plugin was constructing the public_id as fPath + "/" + hashfName without passing the folder parameter separately.

This caused all uploaded images to appear under "Home" in Cloudinary's Media Library Browser view, ignoring the user-configured folder structure.

Change

Split the path into two Cloudinary upload API parameters:

  • folder = fPath (the user-configured folder path)
  • public_id = hashfName (the md5 hash filename)

Cloudinary's Media Library uses the folder parameter to organize assets in its Browser view, so this fix ensures images appear in the correct folder.

Testing

Tested locally with PicGo:

  • Set folder to my-website/test
  • Uploaded an image → appears in my-website/test/ in Cloudinary Media Library Browser view
  • secure_url returned correctly ✅

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant