Open Sheepings opened 4 years ago
You can set file extensions to treat as text files by mapping the file extension to a mime type in Nextcloud. This is not defined by Texteditor but in Nextcloud.
Create (or edit) a file named <nextcloud>/config/mimetypemapping.json
and add your mappings, eg.:
{
"aspx": ["text/code"],
"cs" : ["text/code"]
}
Update Nextcloud's mapping (run with your www-data user):
$ php occ maintenance:mimetype:update-js
Important! Rescan your files to apply changes to existing files (run with www-data user):
$ php occ files:scan --all
References (read them!) :
-## Steps to reproduce
Expected behaviour
I'd expect there would be an interface for adding file extensions which would open custom file types in text/code editor. The expected files should open in an editor. But there is no way to add custom file extensions manually through the Nextcloud web interface, and have them files open in an editor, instead of bring forced to download.
Actual behaviour
The file clicked will start downloading, instead of opening in a text editor. There isn't any menu option to open with text editor either.
UBuntu 18.04:
Web server:
Database: MySQL 5.7.31
PHP version: 7.2.33
Nextcloud version: 19 (see Nextcloud admin page)
Client configuration
Browser: Opera
Operating system: Ubuntu 18.04