Skip to content

Filemanager configuration file

pavel edited this page May 18, 2016 · 46 revisions

The Filemanager uses now a JSON file for sharing configuration between the client-side (javascript part) and the server-side (connector part).

The Filemanager is highly customizable by changing vars values into config files. It is organized in sections.

The default configuration file is visible from code source repository : https://github.com/servocoder/Filemanager/blob/master/scripts/filemanager.config.default.json

For more information on Filemanager setup, see also Specify user folder, configuration cases

The options section

culture - Default value "en". Set culture to display localized messages. Available languages are listed in languages folder.

lang - Default value "php". Set this to the server side language you wish to use. Available values: php, jsp, lasso, asp, cfm, ashx, asp, pl.

theme - Default value "flat-dark". 4 themes are available in the package: default, flat-dark, flat-turquoise and flat-oil. You can create your own theme, simply by following instructions.

defaultViewMode - Default value "grid". Set default view mode : 'grid' or 'list'

localizeGUI - Default value true. Append localized text in GUI. Set to false if you want to set values manually into the HTML file.

showFullPath - Default value false. Display full path or not.

showTitleAttr - Default value false. Display title attributes on mouse hover (main panel only).

browseOnly - Default value false. Allow users to browse only. Prevent upload/dowload and others interactions.

showConfirmation - Default value true. Do show a confirmation message after running actions.

showThumbs - Default value true. Show image previews in grid/list views.

searchBox - Default value true. Display search box on the bottom (left) to let user filter results on special files.

listFiles - Default value true. Display files in left column (filetree). If set to false, will display only folders.

fileSorting - Default value "NAME_ASC". Sorting files criteria. See specific page for available values.

folderPosition - Default value "bottom". Position of folders in files/folders list. Takes value "bottom" or "top".

quickSelect - Default value false. Select file on main listing - avoid an extra click.

charsLatinOnly - Default value true. To allow non-latin characters into folders name, just set it to false.

splitterWidth - Default left column width in pixel. Default to 200 (should be set as numeric value).

splitterMinWidth - Default left column width in pixel. Default to 200 (should be set as numeric value).

dateFormat - Default value "d M Y H:i". Format of the date to display, related to connector. For example see date function page for PHP : http://www.php.net/manual/en/function.date.php

serverRoot - Default value true. By default, the application will search fileRoot folder under server root folder. If fileRoot is set to false, serverRoot value is not interpreted by the filemanager -always true.

fileRoot - Default value false. The application will determine the path itself. Can be overwritten, to display a specific folder under server root or a folder not located under Server root directory. If used with serverRoot set to true, do not provide initial slash to fileRoot value.

fileConnector - Default value "/connectors/(options.lang)/filemanager.(options.lang)". Path to server-side connector script. By default the application will determine it based on lang option. For PHP language it would be: /connectors/php/filemanager.php. Can be overwritten to your own connector script path.

fileRootSizeLimit - Default value false. The maximum allowed root folder total size (in Bytes). If set to false, no size limitations applied.

baseUrl - Default value false. The application will determine the path itself. Can be overwritten, to display a folder not located under Server root directory.

capabilities - Take an array as value. By default, all capabilities handled by the application are available : ["select", "upload", "download", "rename", "move", "replace", "delete"]. You can restrict it by suppressing some of them.

logger - Default value false. If set to true the filemanager will log server-side action into /tmp/filemanager.log file by default. If you want to change the default file path , add the key logfile to the JSON file with the desired value - for example : "logfile": "C:/filemanager_log.txt"

plugins - Plugins to init. Implementation not completed yet.

The security section

allowFolderDownload - Default value is false. Allow users to download a Zip archive of a specific folder and contents (including subfolders).

allowChangeExtensions - Default value is false. Allow users to change extension when renaming files.

allowNoExtension - Default value is false. If set to true, allow users to upload file with no extension.

normalizeFilename - Default value is true. Transliterate and sanitize file/folder name, replaces gaps and some other special chars. Implemented on both client-side (javascript) and server-side (PHP connector). Important: client-side implementation doesn't impact while file uploading, so consider it as an extra layer of protection, but rely on server-side implementation.

uploadPolicy - Default value "DISALLOW_ALL". Takes value "ALLOW_ALL" / "DISALLOW_ALL". If is set to "DISALLOW_ALL", only files with extensions contained in uploadRestrictions array will be allowed. If is set to "ALLOW_ALL", all files will be accepted for upload except for files with extensions contained in uploadRestrictions.

uploadRestrictions - Array of files extensions. Fix restrictions on upload checking extension files.

The exclude section

unallowed_files - Array of files excluded from listing.

unallowed_folders - Array of folders excluded from listing.

unallowed_files_REGEXP - Files excluded from listing, using REGEX.

unallowed_folders_REGEXP - Folders excluded from listing, using REGEX.

The upload section

multiple - Default value true. Do enable multiple uploads, rely on jQuery-File-Upload.

paramName - Default value "files". The parameter name for the file form data (the request argument name). See details.

chunkSize - Default value false. To upload large files in smaller chunks, set this option to a preferred chunk size (in Bytes). If set to false, files will be uploaded as a whole. See details.

numberOfFiles - Default value 5. Maximum number of files to be processed per each multiple upload process. Only used when multiple is set to true. See details.

fileSizeLimit - Default value 16000000 (16 MB). The maximum allowed file size (in Bytes). If set to false, no size limitations applied. See details.

overwrite - Default value false. If set to true, files will be overwritten on uploads if they have same names. If set to false, an index will be added.

imagesOnly - Default value false. If set to true, only images are accepted for upload.

The images section

imagesExt - Array of accepted images extensions.

main subsection. Uploaded image settings. To disable resize set both maxWidth and maxHeight to false.

main.autoOrient - Default value true. Automatically rotate images based on EXIF meta data.

main.maxWidth - Default value 1280. Resize maximum width in pixels. Takes integer values or false.

main.maxHeight - Default value 1024. Resize maximum height in pixels. Takes integer values or false.

thumbnail subsection. Thumbnail creation settings of uploaded image.

thumbnail.enabled - Default value true. Generate thumbnails using PHP to increase performance on listing directory.

thumbnail.cache - Default value true. If set to false, it will generate thumbnail each time the image is requested. Decreased performance.

thumbnail.dir - Default value _thumbs/. Folder to store thumbnails, invisible via filemanager. If you want to make it visible, just remove it from unallowed_files configuration option.

thumbnail.crop - Default value true. Crop thumbnails. Set dimensions below to create square thumbnails of a particular size.

thumbnail.maxWidth - Default value 64. Maximum crop width in pixels.

thumbnail.maxHeight - Default value 64. Maximum crop height in pixels.

The videos section

showVideoPlayer - Default value true. Show browser video player?

videosExt - Array of videos extensions to embed in player.

videosPlayerWidth - Default value 400. Videos player width in pixels

videosPlayerHeight - Default value 222. Videos player height in pixels

The audios section

showAudioPlayer - Default value true. Show browser audio player?

audiosExt - Array of audios extensions to embed in player (default are ogg, mp3, wav).

The pdfs section

showPdfReader - Default value true. Show PDF preview.

pdfsExt - Array of extensions to embed in viewer (default are pdf, odt, odp, ods).

pdfsReaderWidth - Default value 640. Viewer width in pixels.

pdfsReaderHeight - Default value 480. Viewer height in pixels.

The docs section

showGoogleViewer - Default value true. Enable Google Docs Viewer.

docsExt - Array of extensions to embed in viewer (default are doc, docx, xls, xlsx, ppt, pptx).

docsReaderWidth - Default value 640. Viewer width in pixels.

docsReaderHeight - Default value 480. Viewer height in pixels.

The edit section

enabled - Default value true. Enable online edit

lineNumbers - Default value true. Display line numbers into the editor

lineWrapping - Default value true. Enable wrapping into the editor

codeHighlight - Default value false. Enable code highlighter. This feature may slow-down the filemanager.

theme - Default value elegant. Set the editor theme. Available themes are listed here (do not include css extension).

editExt - Array of files extensions for online edition (default are txt, csv).

The customScrollbar section

You can enable the jquery custom scrollbar plugin to enhance UI. Notice, that this will decrease FM loading speed.

enabled - Default value false. Enable it by passing the value true.

theme - Default value true. Specify the scrollbar theme you want to use. See available options.

button - Default value true. Add buttons to scrollbars (takes value true or false).

The extras section

extra_js - Default empty array. Array of javascript files to load. For example use this to load tiny_mce_popup.js

extra_js_async - Default value true. Specify if request is asynchronous or not (takes value true or false).

The icons section

path - Default value "images/fileicons/". Path to icons folder.

directory - Default value _"Open.png". Default directory icon.

default - Default value "default.png". Default file icon.