Skip to content

Commit b2b5a6a

Browse files
committed
Fix file upload bug on server
1 parent 8a0f7b6 commit b2b5a6a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/treaty2/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,13 @@ const createProxy = (
289289
fetchInit.body
290290
)) {
291291
if (isServer) {
292-
formData.append(key, field as any)
293-
292+
if (Array.isArray(field)) {
293+
for (const f of field) {
294+
formData.append(key, f)
295+
}
296+
} else {
297+
formData.append(key, field as any)
298+
}
294299
continue
295300
}
296301

0 commit comments

Comments
 (0)