Skip to content

Better error messages for oversized image uploads (413 response) #2740

Description

@itbane

When uploading a file (e.g. diagrams.net diagram) that's larger then the webservers max file upload size, the upload (obviously) fails. The error message is very unprecise: "An error occurred uploading the image"

Steps To Reproduce

  1. Find out your max file upload size limit (nginx default: 1MB)
  2. Find a file (e.g. image) that's larger
  3. Try uploading the image
  4. See error

Expected behavior
The error message should tell the user the reason for failure, if possible. An example could be:
' The uploaded image was too large.'

In case of a file being too large, the HTTP response code of '413 (entity too large)' can be used to detect this kind of error.

Other reasons for failure should be accounted for as well.

Screenshots
n/a

Your Configuration (please complete the following information):

  • BookStack v21.04.3
  • PHP Version: 7.3.27-1~deb10u1
  • Hosting Method (Nginx/Apache/Docker): nginx

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions