Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: API for apps to register their own MIME types and icons #10131

Closed
arnowelzel opened this issue Jul 6, 2018 · 2 comments
Closed

Comments

@arnowelzel
Copy link
Contributor

Some apps need additional MIME types which are not known in Nextcloud yet.

Examples:

Keeweb: x-application/kdbx for the extension .kdbx (see jhass/nextcloud-keeweb#34)

Drawio: application/x-drawio for the extension .drawio(see pawelrojek/nextcloud-drawio#41)

Unfortunately, an app can not add its own MIME type mapping if needed. Instead the administrator has to extend the mapping in the Nextcloud configuration:

One has to copy /resources/config/mimetypemapping.dist.json to /config/mimetypemapping.json (in the config/ folder at Nextcloud’s root directory). Then you can add your own MIME type mapping according to the documentation of the app which needs it.

There are "hacks" which try to "emulate" this by modifiying the file cache (as described in jhass/nextcloud-keeweb#34) - but this is really just a hack and not a good solution.

So the better way would be an official API which provides the following functions:

  1. Check, if there is an existing MIME type mapping for a given extension and return the MIME type, so an app can use that to register itself as a handler for that type

  2. Add a custom MIME mapping in case there is no mapping available yet.

  3. Delete a custom MIME mapping (for example when an app gets uninstalled)

  4. Add custom icons for MIME types (and remove them when uninstalling the app) - in Draw.io the icons are set "on the fly" inside the file list, which is also more a crude hack than a proper solution. And the file details still show the original default icon and not the custom icon which Draw.io sets dynamically in the file list.

@arnowelzel
Copy link
Contributor Author

Is a duplicate of #9192

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are nextcloud/viewer#2393 ([enhancement] NC needs a mime type handler selector), #4784 (Apps icon are missing), #2632 (Apps are missing icons), #1238 (Apps API Version), and #6493 (Add "Action-icon" API).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants