System Information
- Strapi Version: strapi v4
- Operating System: ubuntu.20.04.3
- Database: SQlite
- Node Version: 6.13.1
- NPM Version: 8.1.2
- Yarn Version: 1.22.17
it’s my fists time using strapi with Cloudinary and I’m having issues of images getting uploaded into /public/uploads/ folder rather than uploading to Cloudinary storage service.
as shown below
“url”: “/uploads/thumbnail_myphoto_46806d2062.jpg”
Please let me know if I am doing it the wrong way cause I have I’ve tried all possible solution & failed.
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: {},
delete: {},
},
},
});
package.json
"devDependencies": {},
"dependencies": {
"@strapi/plugin-i18n": "4.0.0",
"@strapi/plugin-users-permissions": "4.0.0",
"@strapi/provider-upload-cloudinary": "^4.0.0",
"@strapi/strapi": "4.0.0",
"pg": "^8.7.1",
"pg-connection-string": "^2.5.0",
"sqlite3": "5.0.2"
middlewares.js
module.exports = [
'strapi::errors',
{
name: 'strapi::security',
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'", 'https:'],
'img-src': ["'self'", 'data:', 'blob:', 'res.cloudinary.com'],
'media-src': ["'self'", 'data:', 'blob:', 'res.cloudinary.com'],
upgradeInsecureRequests: null,
},
},
},
},
'strapi::cors',
'strapi::poweredBy',
'strapi::logger',
'strapi::query',
'strapi::body',
'strapi::favicon',
'strapi::public',
];
.env
CLOUDINARY_NAME = xxxxxxxxxxx
CLOUDINARY_KEY = xxxxxxxxxxx
CLOUDINARY_SECRET = xxxxxxxxxxx