expressjs/multer — reverse-engineered prompt

Reverse engineered prompt

GitHub

Build me a small Node.js middleware package for Express that makes file upload forms easy to handle. It should work with multipart form submissions only, and when a request comes in it should put normal text fields on the request body and uploaded files on request.file or request.files.

I want it to cover the common cases, one file, an array of files from the same field, and a mix of named fields like avatar plus gallery. It should also support text only multipart forms. Let people choose whether uploads are saved to disk in a destination folder or kept in memory, and make sure saved files get unique names so they do not clash. Include useful file details like original name, mime type, size, path, and buffer when relevant.

Please add options for basic limits and file filtering, and keep it intended for route specific use, not something applied globally. Include tests and a clear README with simple Express examples and a note that forms need the multipart enctype. Look up current docs online if you need to.

Want more depth? Deep Reverse