keystone
keystone copied to clipboard
Image upload crashes keystone if the file is too big for cloudinary
Please add steps to reproduce the problem
- checkout the ecommerce example
- add cloudinary keys (which have a default of 10MB on free plan and 20MB upload size max on paid plans set)
- run it
- login to the backend
- create a new product image
- use an image with >20 MB size
- try to upload it
- after a short time, the server exits with an cloudinary error that tells the user that the upload size is too big

Second related issue to this is setting a maxFileSize on the keystone server config.
- set keystone maxFileSize to <20MB
- try to upload an image with more than >20MB again
- the console shows an error about the maxFileSize configured on the server
- after a short time the server exits with an timeout error (probably keystone tries to upload the image in the background even though it got rejected because of the file size in the first place)

Please describe what you expected to happen:
- the server doesn't exit
- the server gracefully handles the error returned by cloudinary
- the server respects the file upload size correctly
- (maybe) it would be useful to users if the upload components on the admin side would already validate if the selected file/image exceeds the configured maxFileSize on the server
Please add contextual information such as your node version (node -v), or the web browser you used
- I've tested this on the release tag
2022-09-20and onmainbranch - node version 16.17.1
I have set maxFileSize to 2GB. got this error on trying to upload a 1.5GB file:
Seems the limit stays at 200MB.
Using keystone 6.
Want to be able to upload bigger files.
Created issue #9347