Strapi Cloudinary Upload Presets Help

Hi @DMehaffy,

Thanks for the tip, was able to update the configuration so that it is now in the correct location, however I’m still not seeing the upload presets getting triggered.

I am able to successfully upload files to Cloudinary, but they don’t seem to be interacting with any of the upload presets.

I’ve tried including the upload presets inside and outside of the “params” object, and the assets still just go to the top level of my Cloudinary cloud.

//plugins.js
module.exports = ({ env }) => ({
upload: {
provider: ‘cloudinary’,
providerOptions: {
cloud_name: env(‘CLOUDINARY_CLOUD_NAME’),
api_key: env(‘CLOUDINARY_API_KEY’),
api_secret: env(‘CLOUDINARY_API_SECRET’),
secure: true,
upload_preset: env(‘CLOUDINARY_UPLOAD_PRESET’)
}
}
})

I have tried with a form in NextJS the past (non-Strapi app), and gotten the api to trigger properly, here’s an example of the function:

async function handleImageUpload () {
const data = new FormData();
data.append(‘file’, blogpost.media);
data.append(‘upload_preset’, process.env.CLOUDINARY_UPLOAD_PRESET);
data.append(‘cloud_name’, process.env.CLOUDINARY_CLOUD_NAME);
const response = await axios.post(process.env.CLOUDINARY_URL,data);
const mediaUrl = response.data.secure_url;
return mediaUrl;
}

This function would upload a file from the form and then return the url from Cloudinary to be stored in the database with the rest of blog fields in the form. The preset would organize the incoming images into a folder so that images from different websites would be stored separately.