🌐 AI搜索 & 代理 主页
Skip to content

Commit 828b5b4

Browse files
authored
Merge pull request lian-yue#104 from victorzhuk/master
fix. additional file upload with html5 post method
2 parents 57cd9c4 + 09ec1eb commit 828b5b4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/FileUpload.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,11 @@ export default {
744744
for (let key in file.data) {
745745
value = file.data[key]
746746
if (value && typeof value === 'object' && typeof value.toString !== 'function') {
747-
form.append(key, JSON.stringify(value))
747+
if (value instanceof File) {
748+
form.append(key, value, value.name)
749+
} else {
750+
form.append(key, JSON.stringify(value))
751+
}
748752
} else if (value !== null && value !== undefined) {
749753
form.append(key, value)
750754
}

0 commit comments

Comments
 (0)