Last active
December 2, 2017 14:51
-
-
Save NickyYo/1ba41ccdb72b54aa3352e1ccfa44b9b5 to your computer and use it in GitHub Desktop.
Cloudinary upload with 'express' & 'express-fileupload'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cloudinary from 'cloudinary'; | |
cloudinary.config({ | |
api_key: '', | |
api_secret: '', | |
cloud_name: '' | |
}); | |
export function sendMail(req, res) { | |
cloudinary.v2.uploader.upload_stream({ tags: "snap_qoute_me" }, function(error, result) { | |
res.send(200, result.secure_url); | |
res.end(); | |
}).end(req.files.image_1.data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment