我想通过网址将图像上传到cloudinary。我曾尝试下面的代码:无法上传Cloudinary图像Node.js
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()但仍然失败),并且我的控制台上没有错误消息。我不知道发生了什么事。如果有人能帮助我,我真的很感激。