Application Association
LCMD MicroServer's goal is to build a family digital life hub. As more and more ecosystem applications emerge, many files in LCMD Cloud Drive can be directly opened by ecosystem applications.
For example, if you develop a music player, you expect that when users click on music files in LCMD Cloud Drive, LCMD Cloud Drive will automatically pop up an application selection dialog for users to choose.
You only need to add a file_handler field in the lzc-manifest.yml file:
yml
application:
file_handler:
mime:
- audio/mpeg
- audio/mp3
actions:
open: /open?file=%uapplication:
file_handler:
mime:
- audio/mpeg
- audio/mp3
actions:
open: /open?file=%umime: List of MIME types supported by the applicationactions: Action to start the application, currently onlyopenoption
The application needs to support the /open route and parse the content of the file parameter. The system will automatically replace the %u parameter with the actual path of the opened file.
After v1.3.8+, the mime field supports some special configurations:
text/*includes all text category mime types includingtext/plain*/*All file types will be matched, suitable for special application scenarios such as "MD5 calculation" and "file sharing". (Note: add string quotes when writing this, otherwise yaml will try to parse*causing errors)x-lzc-extension/mdAll files with md extension