Mime type change possible?
-
I have a WordPress Multisite installation where users (students) upload large video files. These are mp4 files created with iMovie.
For these large files (over 100 MB), Chrome and iOS will not play the videos, although they play fine in Safari and Firefox.
I have confirmed that IF the files can be served with mime type application/octet-stream, the WordPress automatic embedded player will play them fine on all browsers.
So I want to force the server to send these files with mime type application/octet-stream.
Using AddType in .htaccess does not work, because the files are uploaded using the WordPress uploader, and this means that in multisite they are not located where the URL says they should be– instead of mysite.com/files/year/month/filename.mp4, or even at mysite.com/specific-site-in-multisite/files/year/month/filename.mp4 they are at mysite.com/wp-content/blogs.dir/id-number-of-specific-site-in-multisite/files/year/month/filename.mp4
They are being served (I think) by WordPress php, not by the server itself. So the htaccess AddType directive is not respected for these files at all.
It seems I have to modify the setting in WordPress, to ask it to serve mp4 as application/octet-stream, rather than video/mp4.
This is almost what is being asked and answered here–Change the MIME type in WordPress
But I’m not trying to change allowed upload types, just to change what is served. And I’m not trying to remove an existing type or add a new type, I’m trying to remove an existing type AND add a new replacement type.
Is that possible? Or is there another way to force the server to send these as application/octet-stream?
- The topic ‘Mime type change possible?’ is closed to new replies.