onUploadProgress在axios中没有按预期工作?

时间:2016-12-14 17:48:47

标签: javascript reactjs redux axios

我的用户可以将大量文件上传到aws,因为我必须显示上传进度条。但是axios在上传时显示总价值。我不知道为什么这会在上传时显示总价值到AwsS3

const config = {
    onUploadProgress:function (progressEvt) {
        console.log(progressEvt.loaded)//Showing total value while uploading
    }

}
export function uploadtoCdnAndSaveToDb(data) {
    return dispatch => {
        dispatch(showUnderLoader(true));
        return axios.post('/posttodb',{data:data},config
        ).then(response => {
                console.log(response.data)
        })
    }
}

0 个答案:

没有答案