sveltekit-superforms icon indicating copy to clipboard operation
sveltekit-superforms copied to clipboard

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

Open TheBous opened this issue 1 year ago • 2 comments

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.

TheBous avatar Jul 19 '24 10:07 TheBous

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.

ciscoheat avatar Jul 19 '24 13:07 ciscoheat

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

TheBous avatar Jul 22 '24 08:07 TheBous