Overview
Fixed Folder Mode (Legacy)
In Fixed Folder Mode, the folder structure in the Media Library UI directly corresponds to the public ID path:- Public ID:
my-app/products/image.jpg - Media Library folder:
my-app/products/ - Moving files in the UI changes their public IDs
Dynamic Folder Mode (Modern)
Dynamic Folder Mode separates the UI folder structure (asset_folder) from the public ID path:
- Public ID:
my-app/products/image.jpg - Asset folder:
my-app/products/(UI only) - Display name:
image.jpg(shown in UI) - Moving files in the UI does not change public IDs
- Existing URLs remain valid after moving files
Configuration
Whether to support Dynamic Folder Mode for newer Cloudinary accounts. When
true, the plugin adds the asset_folder parameter to uploads.How It Works
With Dynamic Folder Mode Support (Default)
WhensupportDynamicFolderMode: true, the plugin:
- Generates the public ID as usual (e.g.,
my-app/products/image) - Adds
asset_folderparameter to match the folder path - Files appear in the correct folders in Cloudinary’s Media Library UI
- Public IDs remain stable even if you move files in the UI
Without Dynamic Folder Mode Support
WhensupportDynamicFolderMode: false, the plugin:
- Generates the public ID (e.g.,
my-app/products/image) - Does not add
asset_folderparameter - Relies on Cloudinary’s default folder handling
Benefits of Dynamic Folder Mode
1. Stable URLs
Public IDs don’t change when you reorganize files in the Media Library:2. Better Organization
Separate your organizational structure from your URL structure:3. Migration Support
Reorganize your Media Library without breaking existing URLs in production.Detecting Your Account Type
To check which folder mode your Cloudinary account uses:Method 1: Check Upload Response
Upload a test file and examine the response:Method 2: Check Cloudinary Dashboard
Cloudinary’s documentation or support can confirm your account type.Examples
Basic Setup with Dynamic Folder Mode
Multi-Collection Setup
Different folders for different collections:- Media:
my-app/media/...(if using prefix) - Documents:
my-app/documents/... - Avatars:
my-app/avatars/...
asset_folder parameter for Dynamic Folder Mode.
With Custom Public IDs
Dynamic Folder Mode works seamlessly with custom public ID generation:asset_folder parameter accordingly.
Comparison Table
| Feature | Fixed Folder Mode | Dynamic Folder Mode |
|---|---|---|
| Folder in UI | Matches public ID path | Independent from public ID |
| Moving files in UI | Changes public ID | Does not change public ID |
| API response | folder field | asset_folder + display_name |
| URL stability | URLs break when moved | URLs remain stable |
| Account type | Older accounts | Newer accounts (2021+) |
| Plugin support | Works with supportDynamicFolderMode: true/false | Requires supportDynamicFolderMode: true |
Migration Strategies
From Fixed to Dynamic Folder Mode
If Cloudinary migrates your account:- Update your plugin configuration (usually no change needed - it’s enabled by default)
- Existing files continue to work
- New uploads use
asset_folderparameter - Gradually reorganize your Media Library UI without breaking URLs
Testing Both Modes
For applications that need to work with both account types:Troubleshooting
Files Not Appearing in Expected Folders
Problem: Files upload successfully but don’t appear in the Media Library UI folders. Solution: EnsuresupportDynamicFolderMode: true (it’s the default):
Public IDs Changing When Moving Files
Problem: Moving files in Media Library changes their URLs. Solution: You’re likely using Fixed Folder Mode. Either:- Contact Cloudinary to migrate to Dynamic Folder Mode
- Avoid moving files in the UI
- Update references when moving files
Asset Folder vs Public ID Mismatch
Problem:asset_folder doesn’t match the public ID path.
Solution: The plugin automatically extracts the folder from your public ID. If using custom generatePublicID, ensure it returns the full path:
Best Practices
1. Enable by Default
LeavesupportDynamicFolderMode: true (the default) for maximum compatibility:
2. Consistent Folder Structure
Use consistent folder naming across your application:3. Document Your Structure
Document your public ID and folder structure for your team:4. Test After Changes
After updating folder configuration, verify:- Files upload successfully
- Files appear in correct folders in Media Library UI
- Public IDs follow expected pattern
- URLs work correctly
Further Reading
The plugin handles both Fixed and Dynamic Folder modes automatically when
supportDynamicFolderMode is enabled. You don’t need to know which mode your account uses.