This editor will open any document in an external browser window. That way, if the browser supports a specific format that Pydio does not support, this can be sometime handy.
Integration to the core of the previous hook.openfile plugin contributed by Zly.
Will execute your browser-action for the specified filetype. For example, if you use a pdf reader plugin to open pdf files directly in you browser, this plugin will allow you to do the same when opening files in an Pydio repository.
It creates a new action in Pydio called "Open file (in browser)". This action is available for all filetypes except folders. When you select a file, and execute this action, a new browser window (or tab) will be opened with the file you selected.
Tested on
Linux - Apache 2.X & PHP 5.3.3 - The plugin should work on all platforms and versions that Pydio works on. Feel free to report in the associated thread if you use this plugin on a different setup than mine.
Technical
It sends (hopefully) the correct headers according to the selected file, in combination with the Content-Disposition: inline; header. This is done by guessing the mime-type in a 3-step cycle:
. If the PECL fileinfo extension is available, the finfo class will be used to detect the mime-type.
. Else if the (deprecated) mime_content_type function is available, it will be used.
. Else if the file-extension is in the (included) mime.types file, the mime-type will be guessed by the file-extension.
. If it is not possible to find a mime-type, the file is sent as application/octet-stream, and you browser will most likely open a download dialog.