-
-
Notifications
You must be signed in to change notification settings - Fork 69
Description
Describe the bug
Not a problem for Codidact in production, as the file upload limit is set to 2MB and works correctly, but if another instance of QPixel has the server configuration set to a value smaller than specified in the admin interface then the user will be given no error message, but files of sizes between the 2 different limits will silently fail. To a user who doesn't look in the developer window, it will look like the file is in the process of uploading, but it will never finish.
To Reproduce
At the time of raising this, the dev server has this mismatch, so you can see the lack of error message there.
Steps to reproduce the behavior:
- Go to the edit page for a new/existing post.
- Click on the file upload button.
- Select a file that is a little under 2MB.
- See no indication that anything is wrong.
- The developer console shows an error message
Uncaught (in promise) SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
and the upload line in the Network tab shows a response of413 Request Entity Too Large
from nginx.
Expected behavior
If the response is not JSON there should be a message to the user indicating that the upload failed, and the ![Uploading, please wait...]()
should be removed from the post body.