Details
Description
Steps to reproduce
- Go to a page
- Click Administer Page > Content > Attachments Restriction
- Under 'Allowed Mimetypes', enter "text/plain" and Save
- Edit the page with CKEditor (in-place or WYSIWYG) in realtime (default) edit mode and upload an image through drag & drop
- Observe the message(s) displayed
Expected results
There is only one error message explaining that the file uploaded has an invalid Mimetype (and display the allowed Mimetypes), consistent with the error message displayed when uploading the image through Attachments tab or through Image > Upload tab:
File <filename> has an invalid mimetype image/<type>. Allowed mimetypes: text/plain.
Actual results
When uploading the image via drag & drop in the CKEditor in a realtime editing session, there is even a success message:
File successfully uploaded.
followed just below by an error message:
Error when uploading the file: it might exceed the configured maximum upload size.
which is misleading, because the real reason is the restricted Mimetype.
The issue could not be reproduced when realtime is not active (it seems XWIKI-24567 was fixed for non-realtime editing cases).
There is also a discrepancy between the error message displayed when the image is uploaded through drag & drop and through other modes (like from Attachment tab) in a non-realtime session. The message is currently:
The wiki administrators have defined a mimetype restriction for attached files. Please make sure the mimetype of the files you are trying to attach is allowed ([text/plain]) and not blocked ().
which is not consistent with the message displayed when the file is uploaded through Attachments tab or through Image > Upload tab, see ![]()
Attachments
Issue Links
- is related to
-
XWIKI-24567 Inconsistent error messages when uploading files with restricted Mime types through drag & drop
-
- Closed
-