Failure to upload images from Strapi to a cloudinary folder

System Information
  • **Strapi Versionv4.1.7:
  • **Operating SystemWindows 10:
  • **DatabaseSqlite:
  • **Node Version16.13.1:
  • **NPM Version8.1.2:
  • Yarn Version:

'.m working with Strapi v4.1.7 and I’m trying to upload my images to Cloudinary in a specific folder (portfolio) but they just get added to the root folder of Cloudinary.

Also I’m using “@strapi/provider-upload-cloudinary”: “^4.1.9”, package.

My plugins.js is as follows:

module.exports = ({ env }) => ({
  // ...
  upload: {
    config: {
      provider: "cloudinary",
      providerOptions: {
        cloud_name: env("CLOUDINARY_NAME"),
        api_key: env("CLOUDINARY_KEY"),
        api_secret: env("CLOUDINARY_SECRET"),
      },

      actionOptions: {
        upload: {
          folder: env("CLOUDINARY_FOLDER", "portfolio"),
        },
        delete: {},
      },
    },
  },
  // ...
});

Also in my .env file, I have the folder set as follows:

 ....
 CLOUDINARY_FOLDER=portfolio

Also, I was asking is it possible to create dynamic folders in Cloudinary like ‘/portfolio/Project1/all-project1-assets’ from Strapi for all projects.

I need help to achieve this. Thanks !!!


1 Like
actionOptions: {
    upload: {},
    uploadStream: {
        folder: env("CLOUDINARY_FOLDER"),
     },
     delete: {},
},
2 Likes