Skip to content

BMP image created from Windows paint triggers download on Chrome/Edge #6583

Description

@DefinitiveAbove

Describe the bug
When going to the submission panel/notebook file submission and viewing a BMP from Paint in Chrome/Edge, it instead triggers a download and displays nothing. If you have "Expand files in notebook file submission on page load" enabled and you go to a gradeable with file submission with the image uploaded, it triggers a download shortly after page load from the notebook panel.

Image displays as expected in Firefox.

Expected behavior
The image should display as normal.

To Reproduce
Steps to reproduce the behavior:

  1. Create and save image from Paint (Windows, original Paint) as .bmp (I used "24-bit Bitmap")
  2. Upload file to gradeable submission
  3. Navigate to gradeable submission in submission panel or view file in the notebook file submission section (if it is a notebook with file submission)

Configuration

  • OS: Windows 10
  • Browser: Chrome, Edge

Screenshots
image

Additional context
The image MIME type is image/bmp according to the file command.
When being processed by the function displayFile from MiscController.php, the mime type appears as image/x-ms-bmp.
Hard coding the file type in the function displayFile from MiscController.php as image/bmp leads the file to displaying correctly in Chrome/Edge.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions