nestia
nestia copied to clipboard
Add option to pass `multer` options to Multipart uploads
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
- Add option to be able to pass multer options to multipart uploads
- Use Express.Multer.File type instead of File for files (see https://expressjs.com/en/resources/middleware/multer.html#api)
Thanks!
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?
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
Seems good. What about challenge a PR in here code?
https://github.com/samchon/nestia/blob/master/packages/core/src/decorators/TypedFormData.ts