Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Cloudinary plugin not saving images

default discord avatar
generator1018 months ago
2

omg, the issue is that

app.use(mediaManagement())

has to be above

await payload.init

"payload": "1.10.1", "payload-cloudinary-plugin": "^0.1.0",



i get

APIError: Cloudinary: {}

did you ever resolve this issue?

  • default discord avatar
    miiketranlast year

    hey

    @777369867623858186

    , the payload-cloudinary-plugin worked seamlessly for me.



    Step 1:

    I pasted these values from Cloudinary into my .env file



    CLOUDINARY_CLOUD_NAME=
    CLOUDINARY_API_KEY=
    CLOUDINARY_API_SECRET=

    Step 2:

    I have the same payload.config.ts with plugins: [cloudinaryPlugin()]



    Step 3:

    I followed the Media.ts collection example from

    https://github.com/payloadcms/template-ecommerce

    . staticDir will have the image you upload into your directory.. Instead, I just put

    upload: true

    since I don't want to store these images into my codebase.



    When you save a new media, you'll know it is successful when viewing the new image in a new tab at res.cloudinary.com/<CLOUDINARY_CLOUD_NAME>/image/upload/... The Cloudinary Fields will also be populated onEdit for the media

  • default discord avatar
    antonio_cllast year

    hi folks, anyone has integrated cloudinary with the current suggested plugin?

    https://github.com/finkinfridom/payload-cloudinary-plugin

    I am starting to think that my problem is with the relation created with media because when saving the image i get a 500


    {


    name: "imagenCategoria",


    type: "upload",


    relationTo: "media",


    required: true,


    admin: {


    position: "sidebar",


    },


    },



    Request URL:

    http://localhost:3000/api/media?locale=en&depth=0&fallback-locale=null

    Request Method: POST


    Status Code: 500 Internal Server Error


    Remote Address: [::1]:3000


    Referrer Policy: strict-origin-when-cross-origin



    The payload: {"sizes":{"thumbnail":{},"sixteenByNineMedium":{}},"cloudinary":{}}



    The response: {"errors":[{"message":"Cloudinary: {}"}]}



    My payload.config.ts



    import cloudinaryPlugin from "payload-cloudinary-plugin/dist/plugins";
    
    export default buildConfig({
      serverURL: "http://localhost:3000",
      cors: "*",
      admin: {
        user: Users.slug,
      },
      collections: [Categories, Posts, Tags, Users, Media, Pages],
      globals: [Footer],
      plugins: [cloudinaryPlugin()],
      typescript: {
        outputFile: path.resolve(__dirname, "payload-types.ts"),
      },
      graphQL: {
        schemaOutputFile: path.resolve(__dirname, "generated-schema.graphql"),
      },
    });

    Version:


    "payload": "^1.8.2",


    "payload-cloudinary-plugin": "^0.1.0"

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.