Cloudinary node.js 上传进度

Cloudinary node.js progress of uploading

我在 angularjs web SPA 中使用了 cloudinary 并且有一个很好的回调名为 .progress:

.progress(function (info) {
    //file.progress = Math.round((e.loaded * 100.0) / info.total);
    //file.status = "Uploading... " + file.progress + "%"
    console.log(info);
})

这基本上是使用有关上传状态信息的数据记录对象。

现在我想知道在服务器端通过 nodeJS 代码上传时是否能够以某种方式获得相同的进度

cloudinary.v2.uploader.upload(path, { resource_type: "video" }, function(err, success) {
    console.log('err: ' + JSON.stringify(err));
    console.log('suc: ' + JSON.stringify(success.secure_url));
});

我正在使用 electron,所以我可以使用 ipcMain 将 nodeJS 端与前端进行通信我可以将自定义事件从节点发送到前端,这样我就可以每 1% 的上传传递一个新事件并在前端显示一些进度条。

但是由于 cloduinary 文档没有提供一些关于如何使用 nodejs 获取上传状态的额外信息,我不知道该怎么做以及是否可能。

经过多次谷歌搜索后,我从 cloudinary 合作者那里发现 information on github 进度无法用于服务器端上传。