-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Closed
Closed
Copy link
Labels
bug[triage] something behaving unexpectedly[triage] something behaving unexpectedly
Description
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:
Ghost/ghost/core/core/shared/config/overrides.json
Lines 34 to 45 in 066db4c
| "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
- Create a draft post
- Add an audio card
- Upload an .m4a file using Firefox on Windows
A zipped sample file of silence is attached (but any m4a file should do).
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug[triage] something behaving unexpectedly[triage] something behaving unexpectedly