Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The readMultipartFormData function returns a buffer and does not function properly if the form contains a file. #697

Open
Ray0907 opened this issue Mar 11, 2024 · 0 comments

Comments

@Ray0907
Copy link

Ray0907 commented Mar 11, 2024

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: pnpm@8.15.4
  • Builder: -
  • User Config: runtimeConfig, app, vite, nitro, modules, auth, i18n, dayjs, routeRules, security
  • Runtime Modules: @sidebase/nuxt-auth@0.6.7, @nuxtjs/i18n@8.1.1, dayjs-nuxt@2.1.9, nuxt-security@0.14.4
  • 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

@Ray0907 Ray0907 changed the title readMultipartFormData return buffer and not work if the form contain file The readMultipartFormData function returns a buffer and does not function properly if the form contains a file. Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant