Meteor Lepozepo Cloudinary Generate Signature

╄→尐↘猪︶ㄣ 提交于 2019-12-12 03:43:46

问题


I am trying to upload an image in Meteor with the https://github.com/Lepozepo/cloudinary package. But I am not quite sure how to generate a url. Without it, I get a 401 error.

Server

Cloudinary.config({
    cloud_name: 'sample',
    api_key: '1234567890',
    api_secret: '1AbCDEE789101010'
});

Cloudinary.rules.signature = function() {
  return this.userId;
};

Client

$.cloudinary.config({
cloud_name: 'sample',
api_key: '1234567891234567'

});

'change #image-upload' (event) {
    let files;
    files = event.currentTarget.files;
    return Cloudinary.upload(files, {
        cloud_name: 'sample',
        api_key: '1234567891234567'
    }, function(err, res) {
        console.log("Upload Error: " + err);
        return console.log("Upload Result: " + res);
    });
}

回答1:


Figured it out. I had this incorrect cloud name. The above code should work as long as all your credentials are correct.



来源:https://stackoverflow.com/questions/40063115/meteor-lepozepo-cloudinary-generate-signature

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!