Cloudinary Upload use_filename option

System Information
  • Strapi Version: 3.4.6
  • Operating System: MacOS
  • Database: MongoDB
  • Node Version: 14.15.4
  • NPM Version:
  • Yarn Version: 1.22.10

How can I use the use_filename option that Cloudinary provides? I don’t want my files to be renamed on upload.

I still haven’t figured this one out.

Lets say I have a file named “test.pdf” in my Cloudinary media library.

I have a cloudinary upload preset, which overrides the file if I upload a file with an identical name. This works just fine if I use the Cloudinary UI. But if I upload the file via Strapi, a random string gets added to my file.

How do I prevent this? I want strapi to override the files in cloudinary if they have the same name.

I use the strapi-provider-upload-cloudinary plugin. This is my config:

module.exports = ({ env }) => ({
  upload: {
    provider: 'cloudinary',
    providerOptions: {
      cloud_name: env('CLOUDINARY_NAME'),
      api_key: env('CLOUDINARY_KEY'),
      api_secret: env('CLOUDINARY_SECRET'),
    },
    actionOptions: {
      upload: {
        use_filename: true,
        unique_filename: false,
      },
      delete: {},
    },
  },
});
2 Likes