Progress bar for superagent file upload

元气小坏坏 提交于 2019-12-06 14:41:45

today I met this problem(so I'm writing in this topic...) Docs https://visionmedia.github.io/superagent/ clearly says, that

event is direction: "upload" or "download"

So IMHO you have to do something like:

        if(event.direction === "upload")
            console.log(e.direction,"is done",e.percent,"%")})

and it works so can setState() for progress bar here. It's very dummy, but well. https://visionmedia.github.io/superagent/docs/test.html also here they are using this. Does anyone has better idea for this?

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