files_texteditor
files_texteditor copied to clipboard
Cannot edit powershell file (will be downloaded instead)
Cannot edit powershell scripts... they should be editable according to this list: https://github.com/nextcloud/files_texteditor/blob/cfa393018075029e9486bda604456acee0b6c45f/js/editor.js#L528
Steps to reproduce
- Upload a PowerShell script (.ps1-file)
- Click on it
Expected behaviour
Editor should open...
Actual behaviour
File is downloaded...
Server configuration
Operating system: CentOS 7.5
Web server: Apache
Database: MariaDB
PHP version: 7.1
Nextcloud version: (see Nextcloud admin page) 13.0.5
Where did you install Nextcloud from: nextcloud.com --> download archive
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.jsonand add your mapping, eg.:
{
"ps1" : ["text/code"]
}
- Update Nextcloud's mapping (run with your www-data user):
$ php occ maintenance:mimetype:update-js
- Rescan your files to apply changes to existing files (run with www-data user):
$ php occ files:scan --all
References :
- https://docs.nextcloud.com/server/20/admin_manual/configuration_mimetypes/index.html
- https://help.nextcloud.com/t/mimetype-mapping-problem/8365/2