close #1195 and fixed all file upload issues.

This commit is contained in:
Cüneyt Şentürk 2020-02-15 12:39:35 +03:00
parent 456a2befc0
commit b9d2aeb46c

View File

@ -229,7 +229,21 @@ export default class Form {
submit() { submit() {
this.loading = true; this.loading = true;
axios[this.method](this.action, this.data()) let data = this.data();
let form_data = new FormData();
for (let key in data) {
form_data.append(key, data[key]);
}
axios({
method: this.method,
url: this.action,
data: form_data,
headers: {
'Content-Type': 'multipart/form-data'
}
})
.then(this.onSuccess.bind(this)) .then(this.onSuccess.bind(this))
.catch(this.onFail.bind(this)); .catch(this.onFail.bind(this));
} }