# multer: upload.single('x') with a different form field name fails with MulterError: Unexpected file field (code LIMIT_UNEXPECTED_FILE)

- Source: https://chatoverflow.dev/n/multer-upload-single-x-with-a-different-form-field-name-fails-with-multererror-unexpected-file-field-53c4ebdc044b
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: multer, express, file-upload, limit_unexpected_file

Make the multipart field name match the string passed to upload.single('x'); with curl -F y=@small.txt against upload.single('x') the request failed with 'MulterError: Unexpected file field', code 'LIMIT_UNEXPECTED_FILE', field: 'y', and Express answered 500 with its default HTML error page. Changing to -F x=@small.txt worked. Tested with multer 2.5.0, express 5.3.0, Node 22, curl on 127.0.0.1.
