You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A multer error is thrown and no HTTP response is sent to the client (in Swagger UI, the endpoint loads forever).
MulterError: Unexpected field
at wrappedFileFilter (C:\Users\roy.kakkenberg\WebstormProjects\arvisan-backend\node_modules\multer\index.js:40:19)
at Multipart.<anonymous> (C:\Users\roy.kakkenberg\WebstormProjects\arvisan-backend\node_modules\multer\lib\make-middleware.js:107:7)
at Multipart.emit (node:events:514:28)
at Multipart.emit (node:domain:488:12)
at HeaderParser.cb (C:\Users\roy.kakkenberg\WebstormProjects\arvisan-backend\node_modules\busboy\lib\types\multipart.js:358:14)
at HeaderParser.push (C:\Users\roy.kakkenberg\WebstormProjects\arvisan-backend\node_modules\busboy\lib\types\multipart.js:162:20)
at SBMH.ssCb [as _cb] (C:\Users\roy.kakkenberg\WebstormProjects\arvisan-backend\node_modules\busboy\lib\types\multipart.js:394:37)
at feed (C:\Users\roy.kakkenberg\WebstormProjects\arvisan-backend\node_modules\streamsearch\lib\sbmh.js:248:10)
at SBMH.push (C:\Users\roy.kakkenberg\WebstormProjects\arvisan-backend\node_modules\streamsearch\lib\sbmh.js:104:16)
at Multipart._write (C:\Users\roy.kakkenberg\WebstormProjects\arvisan-backend\node_modules\busboy\lib\types\multipart.js:567:19) {
code: 'LIMIT_UNEXPECTED_FILE',
field: 'files',
storageErrors: []
}
Possible Solution
--
Steps to Reproduce
Copy the example from the TSOA docs to upload files into a controller class.
Try to upload two files (one for each name).
Multer throws an error.
Context (Environment)
Version of the library: 6.2.1
Version of NodeJS: 20.9.0
Confirm you were using yarn not npm: [x]
Detailed Description
For my project, I wish to create and endpoint that takes multiple files as input. These files need to be organized, so I
wish to use a combination of @UploadedFile() and @UploadedFiles() parameters for my endpoint.
PR #1541 implemented multiple files into separate fields, but the test case at
only tests multiple fields with UploadedFile() (the singular, not the plural). Indeed, if I use two fields of the
singular version, the endpoint works fine.
Breaking change?
The text was updated successfully, but these errors were encountered:
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
The docs about file uploads suggest that it is possible to use a combination of
@UploadedFiles()
and@UploadedFile()
in the example.Current Behavior
A multer error is thrown and no HTTP response is sent to the client (in Swagger UI, the endpoint loads forever).
Possible Solution
--
Steps to Reproduce
Context (Environment)
Version of the library: 6.2.1
Version of NodeJS: 20.9.0
Detailed Description
For my project, I wish to create and endpoint that takes multiple files as input. These files need to be organized, so I
wish to use a combination of
@UploadedFile()
and@UploadedFiles()
parameters for my endpoint.PR #1541 implemented multiple files into separate fields, but the test case at
tsoa/tests/fixtures/controllers/postController.ts
Line 71 in 1c4dfbf
only tests multiple fields with
UploadedFile()
(the singular, not the plural). Indeed, if I use two fields of thesingular version, the endpoint works fine.
Breaking change?
The text was updated successfully, but these errors were encountered: