Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-2702

Unknown file extensions should be treated as binary files

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 3.6.5
    • core
    • Yes

      When mapping MIME types, there are generally 3 cases to be accounted for:

      1. File Extensions that are listed in the MIME Mapping Configuration
      2. File Extensions that are not listed in the MIME Mapping Configuration
      3. Paths without a file extension

      Currently, in instance #2, the response is returned as text/html. As a result, if a user uploads a file of a type that Magnolia doesn't know about, the binary content will get dumped directly into the browser window. (This happened for us recently when a site manager uploaded an M4A file, one of the music file formats iTunes supports.) We were able to correct the problem by adding the appropriate MIME type definition to Magnolia's configuration, but it was clear that it would have been far more helpful for Magnolia to treat it as a binary file when it didn't know what the content was.

      Here's a patch that, in instance #2, will return a MIME type of "application/octet-stream" instead of "text/html". Instance #1 and #3 will be unaffected.

        Acceptance criteria

              pbaerfuss Philipp Bärfuss
              seanmctex Sean McMains
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD