I’ve been using the strapi-provider-upload-cloudinary package to connect with my Cloudinary media library, however, I cannot seem to get additional configuration items to work besides the ones required for the connection.
For example, I have upload presets set on Cloudinary, but when I add the value to the settings.json file, they don’t seem to get activated.
I have one that is supposed to organize the files uploaded into a folder, however the images get uploaded into the main space on Cloudinary, not into the folder.
Has anyone been able to get images to upload using a preset and the cloudinary provider?
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.
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.