[ ] Bug report [X] Feature request [ ] Documentation issue or request [ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
there are two interceptors FileInterceptor and FilesInterceptor based on multer.uploadSingle and multer.uploadArray. they allow uploading a single file, or multiple files with same field name. however if say there is a form with two different filed name to be uploaded. like "avatar" and "passport". currently there is not support for multer.fields which addresses this requirement.
based on current implementation, I suggest adding a new interceptor for this behaviour to "@nestjs/common" like:
import {FileFieldsInterceptor} from '@nest/common';
@UseInterceptors(FileFieldsInterceptor([{name: 'avatar', maxCount: 1}, {name: 'passport', maxCount: 1}]))
/...
Hi @thg303,
Good idea! Are you interested in creating a PR? If not, I'll ship it soon anyway 馃憤
here's my PR. please check it out. please let me know if there's anything missed/wrong about it.
PR merged. Leaving opened to remember about the docs
Added in the v5.1.0 release.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Added in the v5.1.0 release.