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

Add option to pass multer options to Multipart uploads #819

Open
fgodino-milu opened this issue Mar 1, 2024 · 3 comments
Open

Add option to pass multer options to Multipart uploads #819

fgodino-milu opened this issue Mar 1, 2024 · 3 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@fgodino-milu
Copy link

Feature Request

Problem

Currently, @TypedFormData.Body() uses multer to read and store file uploads but it doesn't support passing options to the multer singleton.

I am trying to use DiskStorage to store uploads but multer uses MemoryStorage by default.

Additionally, the type of files within @TypedFormData.Body() is File, which hides a lot of the information in Express.Multer.File types and it's not supported in Node versions prior two 20.

Request

  1. Add option to be able to pass multer options to multipart uploads
  2. Use Express.Multer.File type instead of File for files (see https://expressjs.com/en/resources/middleware/multer.html#api)

Thanks!

@samchon samchon self-assigned this Mar 3, 2024
@samchon samchon added the help wanted Extra attention is needed label Mar 3, 2024
@samchon
Copy link
Owner

samchon commented Mar 3, 2024

As I also have to consider the fastify case, supporting express-multer options are not easy problem.

Will you suggest or send a PR that can make both express and fastify compatible?

@fgodino-milu
Copy link
Author

Hi @samchon

I found this package https://www.npmjs.com/package/fastify-multer, which is a port of express-multer. It supports the same options and it outputs the same output types.

I think using this library would simplify it a bit.

Let me know what you think

@samchon
Copy link
Owner

samchon commented Mar 4, 2024

Seems good. What about challenge a PR in here code?

https://github.com/samchon/nestia/blob/master/packages/core/src/decorators/TypedFormData.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants