Strapi - Clouinary connection do not work
In config folder I created file plugins.js with following content:
module.exports = ({
env
}) => ({
// ...
upload: {
provider: 'cloudinary',
providerOptions: {
cloud_name: env('CLOUDINARY_NAME'),
api_key: env('CLOUDINARY_KEY'),
api_secret: env('CLOUDINARY_SECRET'),
},
},
// ...
});
I have installed npm i strapi-provider-upload-cloudinary
then changed file .env to
PORT=1337
CLOUDINARY_NAME="devert0mt"
CLOUDINARY_KEY="413418314534523"
CLOUDINARY_SECRET="******************"```
Actually automatically following code added automatically:
```JWT_SECRET=00b91590-d57a-4577-acad-f02*********
API_TOKEN_SALT=18c5c06ecae64a19080cf89*********
JWT_SECRET=93f65a12-ee69-4e40-990f-497*********
What could be a problem? should CLOUDINARY_SECRET be in "quotes"? or in 'quotes' or without quotes?
Terminal output after adding image is following:
http://localhost:1337
[2021-12-07 02:10:14.702] http: POST /upload (261 ms) 200
[2021-12-07 02:10:14.744] http: GET /upload/files?sort=updatedAt:DESC&page=1&pageSize=10 (24 ms) 200
[2021-12-07 02:10:14.758] http: GET /uploads/thumbnail_Screenshot_2021_11_26_130226_11a95e81ea.png?width=1504&height=1258 (4 ms) 200
All permissions seems to be set...
Also created extentions/upload/config/setting.json with the following content:
"provider": "cloudinary",
"providerOptions": { "cloud_name":"devert0mt",
"api_key": "413418314534523",
"api_secret":"*******************"
}
}{
"provider": "cloudinary",
"providerOptions": { "cloud_name":"devert0mt",
"api_key": "413418314534523",
"api_secret":"**************************"
}
}```
-
Official comment
Hi Adam,
Thanks for pointing us to the article but that is not maintained by Cloudinary.
Could you please create a direct ticket with us via - https://support.cloudinary.com/hc/en-us/requests/new and share with us your cloud name so that we help you debug the issue?
-
UPDATE: I installed Strapi version 3.6.3 and it works well...
0 -
Hey mielenyvin.
Thanks for the update - I'm glad to hear you got it working.
Please let us know if you need anything else, either by replying here or creating a ticket in our support center.
-Danny
Developer Support0 -
I am having the same issue. I could not solve it yet. Toady is the third day I am struggling on it.
0 -
Hi Akim,
Could you please share more information about the issue you are seeing? What version of Strapi do you have installed, are there any errors in the logs with more details about the exact response you're seeing from the Cloudinary API or another reason why it may be failing to send the upload request to Cloudinary?
Please use the steps detailed above by Danny to create a direct ticket with our Support team with the details so that we can assist you with investigating and resolving this issue.
0 -
Hello, same problem.
Strapi 3.6.8
package.json
"dependencies": {"cloudinary": "^1.27.1","into-stream": "^7.0.0","knex": "0.21.18","slugify": "^1.6.3","sqlite3": "5.0.0","strapi": "3.6.8","strapi-admin": "3.6.8","strapi-connector-bookshelf": "3.6.8","strapi-plugin-content-manager": "3.6.8","strapi-plugin-content-type-builder": "3.6.8","strapi-plugin-email": "3.6.8","strapi-plugin-graphql": "^3.6.8","strapi-plugin-i18n": "3.6.8","strapi-plugin-upload": "3.6.8","strapi-plugin-users-permissions": "3.6.8","strapi-provider-upload-cloudinary": "^3.6.8","strapi-utils": "3.6.8"0 -
Hi Anton,
Could you please create a direct ticket with our Support team via https://support.cloudinary.com/hc/en-us/requests/new and share with us the above output, plus your cloud_name and any logs on Strapi showing the error messages for API calls with Cloudinary (if any)? Based on those details, we can check the logs on our side to see if we have received the API calls and if so, what the response was and provide more information if there were any errors.
Best,
Aleksandar0 -
I solve it when uninstall cloudinary v3 and install
@strapi/provider-upload-cloudinary it's v4
then in config/middlewares.js file I change content to
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",];and at plugins.js change it to>>>
module.exports = ({ env }) => ({upload: {config: {provider: "cloudinary",providerOptions: {cloud_name: env("CLOUDINARY_NAME"),api_key: env("CLOUDINARY_KEY"),api_secret: env("CLOUDINARY_SECRET"),},actionOptions: {upload: {},delete: {},},},},});and then worked1 -
Hi Owaini,
Thanks for the recommendation and hope it is working well for your application.
In any case, do let us know any issues/queries or questions you may have by creating a support ticket through https://support.cloudinary.com/hc/en-us/requests/new.
Thanks.
0 -
I adjust the same changes with the new config, but still no success with uploading images from Strapi to Cloudinary
0 -
Hi Michael,
Could you please create a direct ticket with us via - https://support.cloudinary.com/hc/en-us/requests/new and share with us your cloud name? We will then be able to check the logs for your cloud to see if we are receiving the upload requests, what the status of those is.
0 -
Im having the same issue. I think part of the issue is out of date articles like these: https://strapi.io/blog/how-to-build-a-photo-gallery-with-strapi-nextjs-and-cloudinary
1
Post is closed for comments.
Comments
12 comments