Skip to content

Passing parameters to the FM

pavel edited this page Aug 13, 2017 · 16 revisions

RichFilemanager accepts some parameters to be passed into the URL:

Passing a config file

You can pass a javascript config file stored in /scripts/. Note that the config file can also be generated dynamically. It should just return a json object formatted as expected.

http://fm.devale.pro/index.html?config=user.config.json

Changing language

You can specify the language by using langCode.

http://fm.devale.pro/index.html?langCode=zh-cn

Restrict the output with filters

You can show only some type of files by passing the type into the URL with filter parameter.

Available filters are listed in the filter section of your "filemanager.config.json" file.

Feel free to customize the filters list and create your own filters in the configuration files.

http://fm.devale.pro/index.html?filter=image

Opening a given folder

You can open a given folder by passing it into the URL with expandedFolder parameter.

http://fm.devale.pro/index.html?expandedFolder=/My_folder/

Can be combined with exclusiveFolder parameter.

Restrict the view to a given folder

You can restrict the application to view a given folder by passing it into the URL with exclusiveFolder parameter.

http://fm.devale.pro/index.html?exclusiveFolder=/My_folder/

Can be combined with expandedFolder parameter.

IMPORTANT: exclusiveFolder parameter restricts the view, but it can be changed easily by user just by changing parameter value in URL. In other words this method is not safe to prevent users for browsing the default root folder. This is not a permission mechanism. It just applies on displaying files.

Please, do use the connector technique on how to setup dynamic user folder to prevent users to access unwanted/forbidden folders.