Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jedirandy/meteor-cloudinary

cloudinary package for meteor
https://github.com/jedirandy/meteor-cloudinary

Last synced: about 1 month ago
JSON representation

cloudinary package for meteor

Awesome Lists containing this project

README

        

# meteor-cloudinary
Cloudinary NPM, jQuery package for meteor

Current version:

Cloudinary NPM `1.2.5`
https://github.com/cloudinary/cloudinary_npm

Cloudinary jQuery plugin `1.0.25`
https://github.com/cloudinary/cloudinary_js

## Usage

### Server-side:

- initialization
```
cloudinary.config({
cloud_name: 'your cloud name',
api_key: 'your api key',
api_secret: 'your api secret'
});
```

- to get a signature for client-side direct upload
```
var signature = cloudinary.utils.api_sign_request(params, api_secret);
```

- or use this method to get 'form-data' and form attributes to be used by the Cloudinary uploader input
```
var signedData = cloudinary.uploader.direct_upload(callback_url, params);
```

### Client-side:

- insert an input tag
```

```

- set the upload parameters and signature fetched from the server
```
$('#uploader').attr('data-form-data', form_data);
$('#uploader').attr('data-form-url', upload_url);
```

- configurate the input
```
$('#uploader').cloudinary_fileupload({
disableImageResize: false,
imageMaxWidth: 1000,
imageMaxHeight: 1000,
acceptFileTypes: /(\.|\/)(gif|jpe?g|png|bmp|ico)$/i,
maxFileSize: 3000000,
// ...
});
```

See http://cloudinary.com/documentation/jquery_integration#upload_images for more details