Richfilemanager список файлов с пользовательским расширением

RichFileManager-PHP 1 библиотека для просмотра моих файлов S3. Я иду через конфигурацию документ.

Список файлов содержит только стандартные указанные файлы, но я хочу перечислить .TIF расширение файла, а также.

Как я могу позволить список пользовательских файлов расширения в браузере.

0

Решение

Я нашел свой ответ из следующих документ. Чтобы разрешить другое расширение, добавьте имя расширения (т.е. в моем случае tif) в расширение массив, массив будет таким,

$config = [

/**
* Security section
*/
"security" => [
/**
* Default value "false". Allow write operations.
* Set value to "true" to disable all modifications to the filesystem, including thumbnail generation.
*/
"readOnly" => false,
/**
* Filename extensions are compared against this list, after the right-most dot '.'
* Matched files will be filtered from listing results, and will be restricted from all file operations (both read and write).
*/
"extensions" => [
/**
* Default value "ALLOW_LIST". Takes value "ALLOW_LIST" / "DISALLOW_LIST".
* If is set to "ALLOW_LIST", only files with extensions that match `restrictions` list will be allowed, all other files are forbidden.
* If is set to "DISALLOW_LIST", all files are allowed except of files with extensions that match `restrictions` list.
*/
"policy" => "ALLOW_LIST",
/**
* Default value "true".
* Whether extension comparison should be case sensitive.
*/
"ignoreCase" => true,
/**
* List of allowed / disallowed extensions, depending on the `policy` value.
* To allow / disallow files without extension, add / remove the empty string "" to / from this list.
*/
"restrictions" => [
"",
"jpg",
"jpe",
"jpeg",
"gif",
"png",
"svg",
"txt",
"pdf",
"odp",
"ods",
"odt",
"rtf",
"doc",
"docx",
"xls",
"xlsx",
"ppt",
"pptx",
"csv",
"ogv",
"avi",
"mkv",
"mp4",
"webm",
"m4v",
"ogg",
"mp3",
"wav",
"zip",
"md",
"tif"],
],
/**
* Files and folders paths relative to the user storage folder (see `fileRoot`) are compared against this list.
* Matched items will be filtered from listing results, and will be restricted from all file operations (both read and write).
*/
"patterns" => [
/**
* Default value "ALLOW_LIST". Takes value "ALLOW_LIST" / "DISALLOW_LIST".
* If is set to "ALLOW_LIST", only files and folders that match `restrictions` list will be allowed, all other files are forbidden.
* If is set to "DISALLOW_LIST", all files and folders are allowed except of ones that match `restrictions` list.
*/
"policy" => "DISALLOW_LIST",
/**
* Default value "true".
* Whether patterns comparison should be case sensitive.
*/
"ignoreCase" => true,
/**
* List of allowed / disallowed patterns, depending on the `policy` value.
*/
"restrictions" => [
// files
"*/.htaccess",
"*/web.config",
// folders
"*/_thumbs/*",
"*/.CDN_ACCESS_LOGS/*",
],
],
/**
* Default value "true".
* Sanitize file/folder name, replaces gaps and some other special chars.
*/
"normalizeFilename" => true,
],
];
0

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]