Unable To Create Subfolders Using Unsigned Preset

chai
chai Member Posts: 1

Hi Cloudinary team, I'm unable to create a dynamic sub folder using an unsigned preset and the cloudinary API.

My upload preset looks like this:

name/properties

I'm trying to create dynamic subfolders using a unique id + a new subfolder folder to store the images:

/123123/venues/someimage.jpg

/123123/guestrooms/someimage.jpg

My POST request with the body goes to: https://api.cloudinary.com/v1_1/cloudName/image/upload

My post body is:

  1. upload_preset: name/properties
  2. file: (binary)
  3. resource_type: image
  4. folder: 1231231/guestrooms
  5. public_id: test-photo

The response payload is:

{ "asset_id": "91c389085ad0af17ab65cf7fc447176d", "public_id": "1231231/guestrooms/test-photo", "version": 1728933363, "version_id": "18876c725e5fa65353134ebad2ffe97c", "signature": "16f13adfaa1082733f7696ba57f89d49daa529a4", "width": 700, "height": 454, "format": "jpg", "resource_type": "image", "created_at": "2024-10-14T19:16:03Z", "tags": [], "bytes": 120479, "type": "upload", "etag": "f923d8bae6eb146b0932bd323c90162e", "placeholder": false, "url": "http://res.cloudinary.com/name/properties/image/upload/v1728933363/1231231/guestrooms/test-photo.jpg", "secure_url": "https://res.cloudinary.com/name/properties/image/upload/v1728933363/1231231/guestrooms/test-photo.jpg", "asset_folder": name/properties, "display_name": "test-photo", "access_mode": "public", "existing": false, "original_filename": "test-photo" }

However even after adding an asset_folder, folder and changing the public id to create a dynamic subfolder it still doesn't work.

Any help would be appreciated, thanks.


Answers

  • atdatu
    atdatu Member, Cloudinary Staff Posts: 18

    Hi Chai,

    Please raise a support ticket here: https://support.cloudinary.com/hc/en-us/requests/new we may have to look into the environment's configuration and will likely need to verify you. Thanks.