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

Improve the error message displayed when attaching a file with an allowed Mimetype extension but its content doesn't match the allowed Mimetype

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 17.4.0
    • Attachments
    • Windows 11 Pro, Chrome 137, using an instance of XWiki 17.4.1 on PostgreSQL 17, Tomcat 11.0.8
    • Unknown

    Description

      Steps to reproduce

      1. Login as Admin
      2. Go to Administer Wiki > Content > Attachments Restriction
      3. Under "Allowed Mimetypes", insert some file types to be allowed (e.g. text/plain)
      4. Under "Blocked Mimetypes", insert some file types to be restricted (e.g. image/*)
      5. Save
      6. Have an image file with an extension changed to .txt or use the one attached to this issue
      7. Login as an user
      8. Go to a page and upload this file
      9. Observe the received message

      Expected results

      An error message is displayed informing the user that the content of the file doesn't match the allowed file Mimetypes to be uploaded.

      Actual results

      A generic error message is displayed:

      An error occurred while uploading <filename>.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: