【发布时间】:2017-12-02 15:40:46
【问题描述】:
我正在尝试通过 url 将图像上传到 cloudinary。我试过以下代码:
var new_url = $.cloudinary.url(currentPostId+"_front_image.jpg");
console.log(new_url);
console.log("check_first");
Cloudinary.upload(new_url, {public_id: postProperties._id+"_front_image"}, function(err, res) {
console.log(err);
console.log("Upload Result: " + res);
console.log("check_second");
});
console.log("check_third");
我确定 new_url 是有效的,因为我可以打开它并查看图像。我做了两个console.log,但我发现我可以得到“check_first”和“check_third”,但不能得到“check_second”。似乎 Cloudinary.upload 功能不起作用(我也尝试过 cloudinary.uploader.upload() 但仍然失败)并且我的控制台上没有错误消息.我不知道发生了什么。如果有人能提供帮助,我真的很感激。
【问题讨论】:
标签: url meteor file-upload upload cloudinary