fix: Jodit uploader field name mismatch causing MulterError
Jodit sends files as files[0], files[1], ... (from filesVariableName(i)
returning `files[${i}]`), not files[] as previously assumed. The buildData
callback only matched "files[]" so the actual file field was passed
through as-is, triggering MulterError: Unexpected field because backend
multer.single("file") only accepts a field named "file".
Fix buildData to:
- Match files[0], files[1], ... pattern and convert first file to "file"
- Drop extra files (multer.single only accepts one)
- Drop Jodit-internal fields (source, extension, mimetype) backend ignores
Generated with [Devin](https://devin.ai)
Co-Authored-By:
Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Showing
Please register or sign in to comment