Skip to content

Commit 44c4411

Browse files
committed
fix #426
1 parent effa589 commit 44c4411

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/FileUpload.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,10 @@ export default defineComponent({
10371037
}
10381038
}
10391039
// @ts-ignore
1040-
form.append(this.name, file.file, file.file.name || file.file.filename || file.name)
1040+
// Moved file.name as the first option to set the filename of the uploaded file, since file.name
1041+
// contains the full (relative) path of the file not just the filename as in file.file.filename
1042+
// @ts-ignore
1043+
form.append(this.name, file.file, file.name || file.file.name || file.file.filename)
10411044
const xhr = new XMLHttpRequest()
10421045
xhr.open('POST', file.postAction || '')
10431046
return this.uploadXhr(xhr, file, form)

0 commit comments

Comments
 (0)