recommendations icon indicating copy to clipboard operation
recommendations copied to clipboard

Registered MIME types are ignored

Open arnowelzel opened this issue 5 years ago • 2 comments

Some apps register their own MIME types or act as a handler to open certain file types. For example Draw.io can be configured to open XML files or you can add ".drawio" as custom MIME type in /config/mimetypemapping.json (also see https://github.com/pawelrojek/nextcloud-drawio).

Within the file manager this works fine - when clicking an XML file (.xml) or a file with the extension .drawio Draw.io will start and open the file.

However - when I try the same with a file which is on top of the file list as "recommendation" or with an entry in the "recommendet files" box in the dashboard, XML files are always handled as text file and .drawio as unknown type, so only the file manager is opened with the file selected.

What is missing to make this work? Is this a bug in the recommendations app?

arnowelzel avatar Dec 03 '20 18:12 arnowelzel

Hmmm. See https://github.com/nextcloud/recommendations/blob/master/src/components/RecommendedFile.vue. We use the OC.MimeType.getIconUrl function to get the previews and OCA.Viewer.mimetypes to check for possible handling in the Viewer.

I don't know how open with custom mime handlers is done in other places. Can you enlighten me?

ChristophWurst avatar Dec 04 '20 07:12 ChristophWurst

I can reproduce this still in the case of Drawio. Opening the file from the Files recommendations bar takes you to the file as normal, opening it from the Dashboard navigates to it and then downloads it.

Since this app uses the /f/fileid link in case it cannot navigate directly in the Files app (e.g. dashboard), this might be a Nextcloud core/Files app/Drawio app issue instead of this app? It would be interesting to see if this can be reproduced with other apps as well.

NanoSector avatar May 22 '22 15:05 NanoSector