ciscoheat / sveltekit-superforms

Making SvelteKit forms a pleasure to use!
https://superforms.rocks
MIT License
2.13k stars 63 forks source link

Putting dataType: 'json' to enable nested data in a enctype="multipart/form-data" always return value from input type="file" undefined #450

Closed TheBous closed 1 month ago

TheBous commented 1 month ago

In my SvelteKit project, I'm using SvelteKit-Superforms to handle form submissions. The form includes a nested data structure and an image upload field, with enctype="multipart/form-data" set to handle file uploads. However, when I set dataType: 'json', the image field always returns undefined and the image never reaches the server. This issue occurs despite the correct configuration of the form and the expected behavior of handling multipart data.

ciscoheat commented 1 month ago

Hi, that feature is tested and just confirmed to pass, so I'll need a MRE to see the difference. You can use one of the templates here, but please check with the test first if you've overlooked something.

TheBous commented 1 month ago

Thanks @ciscoheat , I didn't see that example!