Cloudinary node.js progress of uploading

旧城冷巷雨未停 提交于 2019-12-13 03:47:27

问题


I used cloudinary in angularjs web SPA and there was nice callback named .progress:

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

which was basically logging object with data about uploading status info.

Now I'm wondering if I'm able to somehow get same progress when uploading by nodeJS code on server side

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));
});

I'm using electron so I can communicate nodeJS side with front with ipcMain I can send custom event from node to front so I can just pass new event every 1% of uploading and display some progressbar on front.

But since cloduinary docs doesn't provide some additional info of how to get status of uploading with nodejs I don't know how to do that and if it is possible.


回答1:


After much more googling I found information on github from cloudinary collaborator that progress isn't available for server-side uploading.



来源:https://stackoverflow.com/questions/51573300/cloudinary-node-js-progress-of-uploading

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