Strapi-provider-upload-cloudinary does not get customConfig options passed (uploads end up in Cloudinary root, not in a folder)

System Information
  • Strapi Version: 3.4.6
  • Operating System: macos 11.1
  • Database: sqlite
  • Node Version: 14.3.0
  • NPM Version: 6.14.4
  • Yarn Version: 1.22.5

I am using strapi-provider-upload-cloudinary to upload to Cloudinary, into a specific folder.
However the uploads end up in the Cloudinary root.

my configuration:

// ./config/plugins.js
module.exports = ({ env }) => ({
  upload: {
    provider: "cloudinary",
    providerOptions: {
      cloud_name: env("CLOUDINARY_NAME"),
      api_key: env("CLOUDINARY_KEY"),
      api_secret: env("CLOUDINARY_SECRET"),
      actionOptions: {
        upload: {
          folder: env("CLOUDINARY_FOLDER"),
        },
        delete: {},
      },
    },
  },
});
#.env
CLOUDINARY_NAME = cloudinary-name
CLOUDINARY_KEY = cloudinary-key
CLOUDINARY_SECRET = cloudinary-secret
CLOUDINARY_FOLDER = foo

When logging the customConfig object that is passed to upload() in strapi-provider-upload-cloudinary, it shows that it is an empty object (ie the default value).

Am I missing something?

1 Like

I have a similar issue. The folder creation and upload is working for me. However, the other two options to avoid a random string concatenated to the filename don’t work :thinking: even tried to pass true/false as a string (“true”/“false”). any ideas on my mistake?


module.exports = ({ env }) => ({

  // ...

  upload: {

    provider: "cloudinary",

    providerOptions: {

      cloud_name: env("CLOUDINARY_NAME"),

      api_key: env("CLOUDINARY_KEY"),

      api_secret: env("CLOUDINARY_SECRET")

    },

    actionOptions: {

      upload: {

        folder: "test",

        use_filename: true,

        unique_filename: false

      },

      delete: {}

    }

  }

  // ...

}); 
1 Like