-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Multer options not applied on field #4843
Comments
Any news on this one? |
So in server/createApp.js the bindBodyParser is imported: And in lib/uploads the configuration is passed to multer: https://github.com/keystonejs/keystone/blob/eb7c1bb0dcea5040f1f13fd42624434223b5c66a/lib/uploads.js#L36 Is this configuration only used on file fields then and not on 'normal' fields like Text etc.? Edit:Also, setting handle uploads to
I can also confirm that the error only appears when my text field value length exceeds the default fieldSize limit of 1 Mb (1048576). |
The problem is not the initialization in server/bindBodyParser.js but the call in admin/server/app/createDynamicRouter.js where it is called without options.
Unfortunately the dynamic router is responsible for CRUD operations which is why an initial file upload works without issues but saving text fields that exceed 1mb (the default multer/busboy restriction) time out with a A simple solution would probably be to use the same config values in createDynamicRouter. |
Expected behavior
I have a model with a watch function that should update a code field on every save.
Actual/Current behavior
When the code field is still empty this works perfectly, but when there's already a value in the code field, I get a Multer error saying my Field value is too long:
Steps to reproduce the actual/current behavior
I pass the multer options in my Keystone init to increase max fieldSize according to this commit:
I add my watch function in my model on to the code field:
When I log the multer options in a pre save hook, it outputs the value correctly:
The code field is quit long (238000 lines), but it seems like the multer options are not being applied?
Thanks!
Environment
The text was updated successfully, but these errors were encountered: