Strapi-provider-upload-cloudinary not transferring media

[details=“System Information”]

  • Strapi Version: 3.5.4:
  • Operating System: Ubuntu 20.04:
  • Database: sqlite3 5.0.0:
  • Node Version: 14.16.0:
  • NPM Version: 6.14.11:
    [/details
    Github link: GitHub - AkshayKumar007/portfolio-v1-api
    I’m trying to use the strapi-provider-upload-cloudinary plugin to upload my media to cloudinary. I have set the .env file and added config/plugins.js in my strapi application. There is no error or warning message in my terminal. The strapi app restarts successfully but the media isn’t transfered to cloudinary. What am I missing. I followed the docs but couldn’t get it working. Any help would be appreciated. Thank you.
    ]

Upload providers can upload only new files, it doesn’t transfer the existing ones.

sir, i don’t have any media uploaded on cloudinary

You can start reading:

and

To connect to cloudinary you only need to modify
./config/plugins.js
You do it right.
Ok.
Last question:
Did you create .env file at the root of your project?

Are you .env looks like this?

CLOUDINARY_NAME=ddic78ds
CLOUDINARY_KEY=22689783767384951
CLOUDINARY_SECRET=*****************************************

If you create an empty project - only one reason if your files don’t upload to Cloudinary - is only incorrect leys in .env

Yes. sir as you can see in my github repo I have done everything you mentioned

.env and keys ?

Yes sir. It is there. Since it’s not a good idea to share it I have added it to the .gitignore.
It’s placed in root directory of project. In fact I have tried all the below commands but non of them worked,

  1. ENV_PATH=~/path-to-directory/portfolio_v1-api/.env npm run start
  2. ENV_PATH=~/path-to-directory/portfolio_v1-api/.env npm run develop
  3. npm run develop
  4. npm run start

I have added .env in github repo for your reference. Kindly look into this as my project is stranded because of this issue. may lose marks in my assignment. :sweat:

I’m see your project and don’t find error.

It’s seems - you don’t install npm module

Please, run
npm i -S strapi-provider-upload-cloudinary

Strapi cloudinary

I’m do this step from scratch:

Create empty project

npx create-strapi-app my-project --quickstart

create ./config/plugins.js from

install npm module

npm i -S strapi-provider-upload-cloudinary

run

strapi develop

Cloudinary is work

Didn’t help. As you can see in node modules. I have plugin installed already. Anyways I ran npm install again just in case you were right.

OK, I register new Cloudinary account and commit my working project with .env
I’m delete git some times later

https://github.com/Ulibka68/strapi-cloudinary-as005-tmp

Thanks. So I shall clone it and re-do my whole backend?

Yes, you can make sure the clodinarу work

I created a new project with the help of Gayrat sir and it’s working. thank you everyone.

It seems like it worked when I enabled all options apart from find and findone in settings > role > public.

mine is not working too, it only works in productions to cloudnary?

is this work the other way around?

for example, i have cloudinary account with some image from strapi provider upload before. My question is, if i have to start a new create strapi app and then connect the strapi provider upload with the token/key from cloudinary before, Is the Media Library going to generate the image/media automatically from cloudinary?

Hello,

I have been trying to use Cloudinary for several days, but I am unable to do so.

I have created the file ./config/plugins.js

module.exports = ({ env }) => ({
  upload: {
    provider: "cloudinary",
    providerOptions: {
      cloud_name: env("CLOUDINARY_NAME"),
      api_key: env("CLOUDINARY_KEY"),
      api_secret: env("CLOUDINARY_SECRET"),
    },
  },
});

I have set the environment variables in the ./.env file or on Heroku.

I am using Strapi version 4.

"dependencies": {
    "@strapi/plugin-i18n": "4.0.0",
    "@strapi/plugin-users-permissions": "4.0.0",
    "@strapi/strapi": "4.0.0",
    "pg": "^8.7.1",
    "pg-connection-string": "^2.5.0",
    "sqlite3": "5.0.2",
    "strapi-plugin-upload": "^3.6.8",
    "strapi-provider-upload-cloudinary": "^3.6.8"
  }

I just found that it works with Strapi 3.6.8 but not with version 4. I don’t know why.

Use this in .config/plugins.js in v4:


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: {},
      },
    },
  },
  // ...
});