keystone icon indicating copy to clipboard operation
keystone copied to clipboard

Image upload crashes keystone if the file is too big for cloudinary

Open mmachatschek opened this issue 3 years ago • 2 comments

Please add steps to reproduce the problem

  1. checkout the ecommerce example
  2. add cloudinary keys (which have a default of 10MB on free plan and 20MB upload size max on paid plans set)
  3. run it
  4. login to the backend
  5. create a new product image
  6. use an image with >20 MB size
  7. try to upload it
  8. after a short time, the server exits with an cloudinary error that tells the user that the upload size is too big

image

Second related issue to this is setting a maxFileSize on the keystone server config.

  1. set keystone maxFileSize to <20MB
  2. try to upload an image with more than >20MB again
  3. the console shows an error about the maxFileSize configured on the server
  4. 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)

image

Please describe what you expected to happen:

  1. the server doesn't exit
  2. the server gracefully handles the error returned by cloudinary
  3. the server respects the file upload size correctly
  4. (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-20 and on main branch
  • node version 16.17.1

mmachatschek avatar Oct 06 '22 14:10 mmachatschek

I have set maxFileSize to 2GB. got this error on trying to upload a 1.5GB file: image Seems the limit stays at 200MB. Using keystone 6. Want to be able to upload bigger files. image

jj-matos avatar Oct 01 '24 18:10 jj-matos

Created issue #9347

jj-matos avatar Oct 02 '24 15:10 jj-matos