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

Inconsistent error messages when uploading files with restricted Mime types through drag & drop

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 18.7.0-rc-1
    • 18.5.0, 18.4.2, 17.10.10
    • Old Core
    • Windows 11 Pro, Chrome 150, using an instance of XWiki 17.10.10 on PostgreSQL 17, Tomcat 9.0.119
    • Integration
    • Unknown
    • N/A
    • N/A

    Description

      Steps to reproduce

      1. Go to a page (e.g. Sandbox)
      2. Click Administer Page > Content > Attachments Restriction
      3. Under 'Allowed Mimetypes', enter "text/plain" and Save
      4. Go to Attachments tab and try to upload an image
      5. Edit the page with CKEditor (in-place or WYSIWYG) and upload an image through Image dialog (by clicking on toolbar > Image > Upload tab)
      6. While keeping the page in CKEditor edit mode, add an external image via drag & drop
      7. Observe the error messages after each upload

      Expected results

      In all situations, there is only an error message explaining that the file uploaded has an invalid Mimetype (and display the allowed Mimetypes).

      Actual results

      When uploading the image through Image Dialog and through Attachments tab, the error message is displayed as expected, but when uploading via drag & drop in the CKEditor, 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.

      Attachments

        Activity

          People

            vmassol Vincent Massol
            iandriuta Ilie Andriuta
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: