Skip to content

Commit 3582809

Browse files
committed
🏭 Support FileList objects in the form data addon
Solves #201
1 parent 411fb09 commit 3582809

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/addons/formData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ function convertFormData(
1212
acc ? `${acc}[${ancestor}]` : ancestor
1313
), null)
1414
formKey = formKey ? `${formKey}[${key}]` : key
15-
if (value instanceof Array) {
16-
for (const item of value)
15+
if (value instanceof Array || (globalThis.FileList && value instanceof FileList)) {
16+
for (const item of value as File[])
1717
formData.append(formKey, item)
1818
} else if (
1919
recursive &&

0 commit comments

Comments
 (0)