I use upload.array('files', 5).
When I send from 1 to 5 files, everything works great !
But when I send 6 files I got the following error :
{ [Error: Unexpected field] code: 'LIMIT_UNEXPECTED_FILE', field: 'files', storageErrors: [] }
According to make-error.js I should get this code LIMIT_FILE_COUNT right ? Or am I missing something ?
I was just thinking about this the other day... It feels kind of strange to get LIMIT_UNEXPECTED_FILE actually.
As it is now, LIMIT_FILE_COUNT is only returned when the global (opposed to per-field) file limit is hit.
Changing this would be a breaking change, although I think it's a good change. I'll add it to the 2.0 alphas shortly, track progress here: #399
You can try it out right now with npm install --save multer@next 馃帀
Works great 馃憤
Most helpful comment
I was just thinking about this the other day... It feels kind of strange to get
LIMIT_UNEXPECTED_FILEactually.As it is now,
LIMIT_FILE_COUNTis only returned when the global (opposed to per-field) file limit is hit.Changing this would be a breaking change, although I think it's a good change. I'll add it to the 2.0 alphas shortly, track progress here: #399