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
The file was sent before the body,so I can't got req.body in multer.diskStorage, I tried everything,finally
I found create new FormData,then use axios to send it to Server could got req.body.My code:
let formData = new FormData()
formData.append("author", _this.$store.state.user.user.username)
formData.append("type", "article")
formData.append("file", $file) // Put it at the bottom
axios({
url: process.env.BASE_API + "/article/upload_img",
method: 'post',
data: formData,
headers: {'Content-Type': 'multipart/form-data', 'token': token},
}).then((res) => { }
Card header image uploaded as temporary Image even if a card is rejected during validation.
See expressjs/multer#299 and expressjs/multer#146
The text was updated successfully, but these errors were encountered: