How to implement jQuery direct upload to Cloudinary on node.js

感情迁移 提交于 2019-12-03 06:44:34
Tal Lev-Ami

Please take a look at the uploader.image_upload_tag at https://github.com/cloudinary/cloudinary_npm/blob/67b7096c7fac2c2bed06603912966495d59dfa34/lib/uploader.coffee#L220 It returns the html for an input tag that can be used together with jquery.cloudinary.js to upload images directly to cloudinary. It will be part of the next release of the npm (expected sometime next week). As for the timestamp - the signature is valid for 1 hour, so there should be plenty of time for the user to upload the image.

if you are using nodejs, this may help

var querystring = require('querystring');

var toHash = querystring.stringify(req.query) + secret;

var signature = sha1(toHash);

function sha1(data) {
var generator = crypto.createHash('sha1');
generator.update(data)
return generator.digest('hex')
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!