Skip to content

Uploading an m4a file to an audio card fails when using Firefox on Windows #16301

@reupen

Description

@reupen

Issue Summary

Hi,

I noticed that it's not possible to upload an m4a file to an audio card using Firefox on Windows. If you try to do so, the error 'Please select a valid media file.' is displayed.

There is no problem using Chrome.

The difference I can see is that Firefox specifies the MIME type audio/mp4, while Chrome specifies audio/x-m4a.

Perhaps audio/mp4 is just missing from this list:

"contentTypes": [
"video/mp4",
"video/webm",
"video/ogg",
"audio/mpeg",
"audio/vnd.wav",
"audio/wave",
"audio/wav",
"audio/x-wav",
"audio/ogg",
"audio/x-m4a"
]

Steps to Reproduce

  1. Create a draft post
  2. Add an audio card
  3. Upload an .m4a file using Firefox on Windows

A zipped sample file of silence is attached (but any m4a file should do).

silence.zip

Ghost Version

5.35

Node.js Version

18.14.1

How did you install Ghost?

Tested both native on Ubuntu 22.04 and using the container image

Database type

MySQL 8

Browser & OS version

Firefox 111 beta 2, Windows 10

Relevant log / error output

[2023-02-20 21:36:24] ERROR "POST /ghost/api/admin/media/upload/" 415 25ms

Please select a valid media file.

Error ID:
    a0036130-b166-11ed-9f6d-e54eb9848d84

----------------------------------------

UnsupportedMediaTypeError: Please select a valid media file.
    at mediaUploadValidation (/var/lib/ghost/versions/5.35.0/core/server/web/api/middleware/upload.js:194:25)
    at Layer.handle [as handle_request] (/var/lib/ghost/versions/5.35.0/node_modules/express/lib/router/layer.js:95:5)
    at next (/var/lib/ghost/versions/5.35.0/node_modules/express/lib/router/route.js:144:13)
    at /var/lib/ghost/versions/5.35.0/core/server/web/api/middleware/upload.js:113:9
    at Immediate._onImmediate (/var/lib/ghost/versions/5.35.0/node_modules/multer/lib/make-middleware.js:53:37)
    at processImmediate (node:internal/timers:468:21)

Code of Conduct

  • I agree to be friendly and polite to people in this repository

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug[triage] something behaving unexpectedly

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions