Strapi-provider-upload-cloudinary not transferring media

Hi dear I tryed your solution it doesn’t seem to be working on mine, it uploads to cloudinary but I don’t get any response calling it’s respective collection type on the response.
I’ve v4 too.

Hi Diebraga! You get a solution? I’m getting the same error here

I am running Strapi V4 and this solution is not working for me. Please you’ve get a workaround?

Found the solutions here

2 Likes

I am running Strapi v4 and did all the steps in the github repo you linked, but I still have the problem.
Strapi uploads to /upload and not to cloudinary.

Hi guys so sorry the delay, I changed to graphic it’s working fine but if you’re working with rest there’s a work around if you pass at the end the flag “populate=fieldName” it works ex"/api/users?populate=avatar" it works aswell for nested fields not showing up.

Thanks you very much dude!

check this out, found this solution on the other thread, works for me

Yes I manage to finally find this. I am not sure why but strapi didn’t run the middleware file of the environment config/env/staging/middleware.js, but rather the one directly inside /config so it is confusing.
Thank you

This works for me. Try npm install @strapi/provider-upload-cloudinary instead of strapi-provider-upload-cloudinary.

and use this code for the ./config/plugins.js file:

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

Hey guys, cloudinary is still not working for me.

I’ve tried setting it up in a new project, theese are the dependencies:

  "dependencies": {
    "@strapi/plugin-i18n": "4.0.4",
    "@strapi/plugin-users-permissions": "4.0.4",
    "@strapi/provider-upload-cloudinary": "4.0.4",
    "@strapi/strapi": "4.0.4",
    "sqlite3": "5.0.2"
  },

I’ve tried this plugin.js:

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

The keys were added in the .env file.

Also modified middlewares.js to include:

{
    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,
        },
      },
    },
  },

I’ve uploaded new data to the collection, and when querying the endpoint, i still get the image url to be /uploads/myImage.jpg".

EDIT: forgot to mention, I’ve tried playing with the permission of the public user in regard to the endpoints, still no luck.

Any suggestions?

1 Like

Strapi Version: 3.6.8
Operating System: macOS Catalina 10.15.4
Database: PostgreSQL 8.5.1
Node Version: 14.16.0
Yarn Version: 1.22.10

I’m having the same exact issue right now! What’s weird is the video I uploaded to Strapi yesterday (same format as the one I’m trying to upload now - Quicktime; .mov file) transfers over to Cloudinary and displays in my frontend just fine. However, the video that I’m attempting to upload now to Strapi, behaves the exact same way as you’ve described here, i.e., when “console.logging()” the url of the video it spits back /uploads/... instead of “https://res.cloudinary.com/…”

Is this a Strapi issue or a settings issue within Cloudinary?

Did you find a workable solution?

FYI found the answer that worked for me here: Strapi not uploading to Cloudinary after a lot of swearing