Directly download an MKV when clicking on it?

Nextcloud version: 17.0.0
Operating system and version: Debian 9
Apache or nginx version: Apache 2
PHP version : 7.2

Clicking an MKV creates a pop-up that fails to load the media instead of directly downloading it. Is there any way to disable this kind of behavior and trigger a download when clicking on an .MKV?

I think Nextclouds own video player doesn’t supports .mkv file. Therefore the behavior of how to handle these files is usually managed in the used web browser and not on the server. There you can decide what should be done if such file is found, directly play with in a local media player, store in a specific folder or ask what the user wants to do.

i found how … maybe im too late :slight_smile:

1.Copy alias :

sudo cp /usr/share/nginx/nextcloud/resources/config/mimetypealiases.dist.json /usr/share/nginx/nextcloud/config/mimetypealiases.json

2.Copy mapping :

sudo cp /usr/share/nginx/nextcloud/resources/config/mimetypemapping.dist.json /usr/share/nginx/nextcloud/config/mimetypemapping.json

  1. Update mimestype:

sudo -u www-data php /usr/share/nginx/nextcloud/occ maintenance:mimetype:update-js

after restart web server :

sudo service nginx restart

  1. Edit and change mapping :

sudo nano /usr/share/nginx/nextcloud/config/mimetypemapping.json

you want directly download ex :

"mkv": ["video/x-matroska"],

for

"mkv": ["application/octet-stream"],

avi mp4 etc …

  1. Update existing files mapping :

sudo -u www-data php /usr/share/nginx/nextcloud/occ files:scan --all

  1. refresh user browser

et voila …