h3
h3 copied to clipboard
The readMultipartFormData function returns a buffer and does not function properly if the form contains a file.
Environment
- Operating System: Darwin
- Node Version: v18.19.0
- Nuxt Version: 3.10.3
- CLI Version: 3.10.1
- Nitro Version: 2.9.3
- Package Manager: [email protected]
- Builder: -
- User Config: runtimeConfig, app, vite, nitro, modules, auth, i18n, dayjs, routeRules, security
- Runtime Modules: @sidebase/[email protected], @nuxtjs/[email protected], [email protected], [email protected]
- Build Modules: -
Reproduction
As described subsequently
Describe the bug
According to the documentation at https://h3.unjs.io/utils/request#readmultipartformdataevent, the object should consist of key-value pairs from FormData. However, I received this response: { name: 'NAME', data: <Buffer > }
. When I attempted to add file upload, it crashed. I previously used formidable to parse the file, but encountered issues with the callback not working. Therefore, I attempted to use readMultipartFormData to handle the FormData, but still encountered errors.
Additional context
No response
Logs
No response