You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.
Reproduction Link
1、第一种写法(the First method)

……
let formData = new window.FormData()
formData.append('roomId', roomId)
formData.append('file', file)
this.$http.post(url, formData, {
headers: {'Content-Type': 'multipart/form-data'},
progress: function (e) {
console.log(123456)
console.log(e.loaded / e.total * 100)
}
}).then(function (response) {
console.log('success')
console.log(response)
}, function (response) {
console.log('err')
})
【chrome】报错:

【server】报错:
[Thread: http-bio-80-exec-6]-[com.jfinal.core.ActionHandler.handle()]: /api/live_m/addZip?mid=64&token=e10adc3949ba59abbe56e057f20f883e
java.lang.RuntimeException: java.io.IOException: Posted content type isn't multipart/form-data
=========================================================================

2、第二种写法(the Second method)
……
let formData = new window.FormData()
formData.append('roomId', roomId)
formData.append('file', file)
this.$http.post(url, formData, {
headers: {'Content-Type': 'multipart/form-data'}
}, {
progress: function (e) {
console.log(123456)
console.log(e.loaded / e.total * 100)
}
}).then(function (response) {
console.log('success')
console.log(response)
}, function (response) {
console.log('err')
})
结果:

【server】: no Error
Steps to reproduce
What is Expected?
请问怎么样写才能得到上传的进度?
Excuse me, how to get the upload progress ?
What is actually happening?
The text was updated successfully, but these errors were encountered: