Plugins You can find out about all the publicly available Grails plugins.

Grails Cloudinary Plugin

  • Tags: images, upload
  • Latest: 1.0.4
  • Last Updated: 16 May 2016
  • Grails version: 2.4 > *
  • Authors: Meni Lubetkin
0 vote
compile "org.grails.plugins:cloudinary:1.0.4"

 Documentation  Source  Issues


Simplifies the usage of the cloudinary service at


Author: Meni Lubetkin

Plugin based on the Cloudinary Java Library that simplifies the usage of the cloudinary image api service inside your grails application.

Album - Sample application based on the plugin:

initial work by Simon Buettner was done at:


To use the plugin you have to create an account at install plugin and by adding to BuildConfig.groovy:

compile ':cloudinary:LATEST_VERSION'

After that you can configure the plugin by providing the following cloudinary related properties:

* Cloudinary
grails.plugin.cloudinary.apiKey = ''
grails.plugin.cloudinary.apiSecret = ''
grails.plugin.cloudinary.cloudName = ''

Upload image/file

You can use the CloudinaryService provided by the api. If you want to leverage the full cloudinary java api just use the cloudinary property on the service. Here is an example of how to upload an image directly from a grails controller action:

MultipartFile imageFile = request.getFile('image')
    if (!imageFile?.empty) {
        Map uploadResults = cloudinaryService.upload(imageFile.bytes)

Please make sure that your form has the right enctype attribute: enctype="multipart/form-data".

The upload method returns a Map of the uploaded image's properties including image URL and Public ID and is available for immediate delivery the image in Cloudinary is identify by Public ID - the image identifier.

Upload image with options

in the upload you can specify a file, local path, public HTTP URL, an S3 URL or an actual image file's data

CloudinaryUploadResult upload(byte[] imageData, Map<String, Object> options = [:])

you can assign upload options in a map - like your own public id, tranformations or tags. see the full list of options:

Display images

The plugin provides two simple tags under the taglibrary namespace cl. To embedd an image tag inside your gsp simply use the cl:img tag:

<cl:img id="${publicId}" width="200" height="200" crop="fit"/>
You can also just render the images url using the cl:src tag:

<cl:src id="${publicId}" width="100" height="100" crop="fit"/>

Delete images Deleting an image is simple. Just use the appropriate method from the CloudinaryService:


More info:

Apache License