Skip to content

Commit ea290ea

Browse files
committed
Fix lian-yue#33. Move the file field to the end of form-data
1 parent 9f5babc commit ea290ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/FileUpload.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,10 +547,10 @@ export default {
547547
548548
_fileUploadHtml5(file) {
549549
var form = new window.FormData();
550-
form.append(this.name, file.file);
551550
for (var key in file.data) {
552551
form.append(key, file.data[key]);
553552
}
553+
form.append(this.name, file.file);
554554
var xhr = new XMLHttpRequest();
555555
xhr.open('POST', file.postAction);
556556
this._fileUploadXhr(xhr, file, form);
@@ -588,7 +588,6 @@ export default {
588588
form.setAttribute('method', 'POST');
589589
form.setAttribute('target', 'upload-iframe-' + file.id);
590590
form.setAttribute('enctype', 'multipart/form-data');
591-
form.appendChild(file.el);
592591
593592
for (let key in file.data) {
594593
let input = document.createElement('input');
@@ -598,6 +597,7 @@ export default {
598597
form.appendChild(input);
599598
}
600599
600+
form.appendChild(file.el);
601601
602602
603603
var getDocumentData = function() {

0 commit comments

Comments
 (0)