Skip to content

Instantly share code, notes, and snippets.

View tonymobster's full-sized avatar

Anthony Acquah tonymobster

View GitHub Profile
@tonymobster
tonymobster / express.js
Last active December 26, 2015 04:28
Code to enable use of 2 Cloudinary file upload tags on the same page.
// handlebars helper to make the cloudinary_uploader_image_upload_tag work in my hbs template
// fieldname: the value to use for data-cloudinary-field
// resourceType: "raw" for raw files, "image" for images
// cloudinaryTagName: "cloudinary-fileupload" for images, "cloudinary-fileupload-file" for raw files
// tag: custom tag for uploaded files
hbs.registerHelper("cloudinary_uploader_image_upload_tag", function(fieldname, resourceType, cloudinaryTagName, tag){
return new hbs.SafeString(cloudinary.uploader.image_upload_tag(fieldname, {
callback: cloudinary_cors,