How to change default app to open format

Nextcloud version (eg, 20.0.5): 20.0.11
Operating system and version (eg, Ubuntu 20.04): Debian 10
Apache or nginx version (eg, Apache 2.4.25): 2.4
PHP version (eg, 7.4): 7.2

Im trying to setup a Virtual Data Room for share files with watermarks and hide downloads. I was able to enable watermarks with Collabora or Onlyoffice for office documents (xlsx, docx, odt, etc). My problem is i dont know how to force open PDF files with Collabora Online. It opens every time with PDF-viewer and if i disable PDF-viewer if prompts for download.

I tried also with Onlyoffice, it has checkboxes for selecting formats you want to open with it, but it does not work. Also, trying to open the PDF with Onlyoffice is not working so it shows an error that it lost connection with server, so i prefer collabora to open the PDF file if possible.


I think can always change the (public) sharing path




But the user can change it back and download the PDF again.
Also there is a download option in OnlyOffice.

If a user can see a document, mostly he/she can download it.
Open e.g. Network Analysis in your browser (F12).


I dont care for the moment about downloads. But i want by default the pdf files to open with collabora. I understand the trick and it work, but what i want is when some user click the pdf file it loads on collabora.

Seems there’s a ticket open for letting users or admins choose which app should open a given application type, as you’d like.

If you need a work-around, you might create a ‘config/mimetypemapping.json’ file as described here, and tell Nextcloud that ‘.pdf’ files are really ‘x-office/document’ or some other mime-type that would open with Collabora. Collabora should re-evaluate and open it as PDF. This will apply for all PDF documents across all accounts on your instance, if it works at all.