Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25892

Inconsistent error messages when uploading files with restricted Mime types through drag & drop still occurs in realtime editing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 18.7.0-rc-1
    • Realtime
    • Windows 11 Pro, Chrome 158, using an instance of XWiki 18.7.0 RC1 on Oracle 19c, Tomcat 11
    • Unknown

    Description

      Steps to reproduce

      1. Go to a page
      2. Click Administer Page > Content > Attachments Restriction
      3. Under 'Allowed Mimetypes', enter "text/plain" and Save
      4. Edit the page with CKEditor (in-place or WYSIWYG) in realtime (default) edit mode and upload an image through drag & drop
      5. 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

          Activity

            People

              Unassigned Unassigned
              iandriuta Ilie Andriuta
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: