diff --git a/README.md b/README.md
index 336c02e6..65c6905f 100644
--- a/README.md
+++ b/README.md
@@ -7,9 +7,11 @@
[![Paypal](https://img.shields.io/badge/Donate-Paypal-lightgrey.svg?style=flat-square)](https://www.paypal.me/prasathmani)
![GitHub Sponsors](https://img.shields.io/github/sponsors/prasathmani)
-> TinyFileManager is web based PHP file manager and it is a simple, fast and small size in single-file PHP file that can be dropped into any folder on your server, multi-language ready web application for storing, uploading, editing and managing files and folders online via web browser. The Application runs on PHP 5.5+, It allows the creation of multiple users and each user can have its own directory and a build-in support for managing text files with cloud9 IDE and it supports syntax highlighting for over 150+ languages and over 35+ themes.
+> TinyFileManager is a versatile web-based PHP file manager designed for simplicity and efficiency. This lightweight single-file PHP application can be effortlessly integrated into any server directory, allowing users to store, upload, edit, and manage files and folders directly through their web browser.
+With multi-language support and compatibility with PHP 5.5+, TinyFileManager enables the creation of individual user accounts, each with its dedicated directory. The platform also includes built-in functionality for handling text files using the Cloud9 IDE.
+Featuring syntax highlighting for over 150 languages and more than 35 themes, TinyFileManager offers a comprehensive solution for file management in an online environment.
-**Caution!** _Avoid utilizing this script as a standard file manager in public spaces. It is imperative to remove this script from the server after completing any tasks._
+**Caution!** _Avoid utilizing this script as a standard file manager in public spaces. It is imperative to remove this script from the server after completing any tasks._
## Demo
@@ -46,81 +48,23 @@ To enable/disable authentication set `$use_auth` to true or false.
### :loudspeaker: Features
-- :cd: Open Source, light and extremely simple
-- :iphone: Mobile friendly view for touch devices
-- :information_source: Basic features likes Create, Delete, Modify, View, Download, Copy and Move files
-- :arrow_double_up: Ajax Upload, Ability to drag & drop, upload from URL, multiple files upload with file extensions filter
-- :file_folder: Ability to create folders and files
-- :gift: Ability to compress, extract files (`zip`, `tar`)
-- :sunglasses: Support user permissions - based on session and each user root folder mapping
-- :floppy_disk: Copy direct file URL
-- :pencil2: Cloud9 IDE - Syntax highlighting for over `150+` languages, Over `35+` themes with your favorite programming style
-- :page_facing_up: Google/Microsoft doc viewer helps you preview `PDF/DOC/XLS/PPT/etc`. 25 MB can be previewed with the Google Drive viewer
-- :zap: Backup files and IP blacklist and whitelist
-- :mag_right: Search - Search and filter files using `datatable js`
-- :file_folder: Exclude folders and files from listing
-- :globe_with_meridians: Multi-language(32+) support and for translations `translation.json` is file required
-- :bangbang: lots more...
-
-## Deploy by Docker
-
-Make sure you have **already installed docker**, [Install reference](https://docs.docker.com/engine/install/)
-
-> **Notice:** Your need an absolute path, and it will be served by tinyfilemanager.
->
-> If you want to serve this project at **raspberry pi or another special platform**, you can download project and **build image by yourself**.
-
-You can execute this following commands:
-
-```shell
-$ docker run -d -v /absolute/path:/var/www/html/data -p 80:80 --restart=always --name tinyfilemanager tinyfilemanager/tinyfilemanager:master
-$ docker ps
-CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
-648dfba9c0ff tinyfilemanager/tinyfilemanager:master "docker-php-entrypoi…" 4 minutes ago Up 4 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp tinyfilemanager
-```
-Access `http://127.0.0.1/` and enter default username and password, then enjoy it.
-
-DockerHub: [https://hub.docker.com/r/tinyfilemanager/tinyfilemanager](https://hub.docker.com/r/tinyfilemanager/tinyfilemanager)
-
-#### How to change config within docker
-
-Origin:
-
-```php
-// Root path for file manager
-// use absolute path of directory i.e: '/var/www/folder' or $_SERVER['DOCUMENT_ROOT'].'/folder'
-$root_path = $_SERVER['DOCUMENT_ROOT'];
-
-// Root url for links in file manager.Relative to $http_host. Variants: '', 'path/to/subfolder'
-// Will not working if $root_path will be outside of server document root
-$root_url = '';
-```
-
-Modified:
-
-```php
-// Root path for file manager
-// use absolute path of directory i.e: '/var/www/folder' or $_SERVER['DOCUMENT_ROOT'].'/folder'
-$root_path = $_SERVER['DOCUMENT_ROOT'].'/data';
-
-// Root url for links in file manager.Relative to $http_host. Variants: '', 'path/to/subfolder'
-// Will not working if $root_path will be outside of server document root
-$root_url = 'data/';
-```
-
-Then, change another config what you want, and add a new volume `-v /absolute/path/index.php:/var/www/html/index.php` in `docker run` command, like this:
-
-```shell
-$ docker run -d -v /absolute/path:/var/www/html/data -v /absolute/path/index.php:/var/www/html/index.php -p 80:80 --restart=always --name tinyfilemanager tinyfilemanager/tinyfilemanager:master
-```
-
-#### Stop running
-
-If you want to stop a running docker service, or you want to restart a service, you should stop it first, or you got `docker: Error response from daemon: Conflict. The container name "/tinyfilemanager" is already in use by container ...` problem. You can execute this command:
-
-```shell
-$ docker rm -f tinyfilemanager
-```
+- :cd: **Open Source:** Lightweight, minimalist, and extremely simple to set up.
+- :iphone: **Mobile Friendly:** Optimized for touch devices and mobile viewing.
+- :information_source: **Core Features:** Easily create, delete, modify, view, download, copy, and move files.
+- :arrow_double_up: **Advanced Upload Options:** Ajax-powered uploads with drag-and-drop support, URL imports, and multi-file uploads with extension filtering.
+- :file_folder: **Folder & File Management:** Create and organize folders and files effortlessly.
+- :gift: **Compression Tools:** Compress and extract files in `zip` and `tar` formats.
+- :sunglasses: **User Permissions:** User-specific root folder mapping and session-based access control.
+- :floppy_disk: **Direct URLs:** Easily copy direct URLs for files.
+- :pencil2: **Code Editor:** Includes Cloud9 IDE with syntax highlighting for 150+ languages and 35+ themes.
+- :page_facing_up: **Document Preview:** Google/Microsoft document viewer for PDF/DOC/XLS/PPT, supporting previews up to 25 MB.
+- :zap: **Security Features:** Backup capabilities, IP blacklisting, and whitelisting.
+- :mag_right: **Search Functionality:** Use `datatable.js` for fast file search and filtering.
+- :file_folder: **Customizable Listings:** Exclude specific folders and files from directory views.
+- :globe_with_meridians: **Multi-language Support:** Translations available in 35+ languages with `translation.json`.
+- :bangbang: **And Much More!**
+
+### [Deploy by Docker](https://github.com/prasathmani/tinyfilemanager/wiki/Deploy-by-Docker)
### License, Credit
diff --git a/tinyfilemanager.php b/tinyfilemanager.php
index e9b05cf1..e6633e7f 100644
--- a/tinyfilemanager.php
+++ b/tinyfilemanager.php
@@ -3,14 +3,14 @@
$CONFIG = '{"lang":"en","error_reporting":false,"show_hidden":false,"hide_Cols":false,"theme":"light"}';
/**
- * H3K - Tiny File Manager V2.5.5
+ * H3K - Tiny File Manager V2.6
* @author CCP Programmers
* @github https://github.com/prasathmani/tinyfilemanager
* @link https://tinyfilemanager.github.io
*/
//TFM version
-define('VERSION', '2.5.5');
+define('VERSION', '2.6');
//Application Title
define('APP_TITLE', 'Tiny File Manager');
@@ -59,6 +59,7 @@
// Root path for file manager
// use absolute path of directory i.e: '/var/www/folder' or $_SERVER['DOCUMENT_ROOT'].'/folder'
+//make sure update $root_url in next section
$root_path = $_SERVER['DOCUMENT_ROOT'];
// Root url for links in file manager.Relative to $http_host. Variants: '', 'path/to/subfolder'
@@ -143,23 +144,23 @@
// if User has the external config file, try to use it to override the default config above [config.php]
// sample config - https://tinyfilemanager.github.io/config-sample.txt
-$config_file = __DIR__.'/config.php';
+$config_file = __DIR__ . '/config.php';
if (is_readable($config_file)) {
@include($config_file);
}
// External CDN resources that can be used in the HTML (replace for GDPR compliance)
$external = array(
- 'css-bootstrap' => '',
+ 'css-bootstrap' => '',
'css-dropzone' => '',
'css-font-awesome' => '',
- 'css-highlightjs' => '',
- 'js-ace' => '',
- 'js-bootstrap' => '',
+ 'css-highlightjs' => '',
+ 'js-ace' => '',
+ 'js-bootstrap' => '',
'js-dropzone' => '',
'js-jquery' => '',
'js-jquery-datatables' => '',
- 'js-highlightjs' => '',
+ 'js-highlightjs' => '',
'pre-jsdelivr' => '',
'pre-cloudflare' => ''
);
@@ -173,7 +174,7 @@
define('UPLOAD_CHUNK_SIZE', $upload_chunk_size_bytes);
// private key and session name to store to the session
-if ( !defined( 'FM_SESSION_ID')) {
+if (!defined('FM_SESSION_ID')) {
define('FM_SESSION_ID', 'filemanager');
}
@@ -228,8 +229,9 @@
}
session_cache_limiter('nocache'); // Prevent logout issue after page was cached
- session_name(FM_SESSION_ID );
- function session_error_handling_function($code, $msg, $file, $line) {
+ session_name(FM_SESSION_ID);
+ function session_error_handling_function($code, $msg, $file, $line)
+ {
// Permission denied for default session, try to create a new one
if ($code == 2) {
session_abort();
@@ -261,7 +263,7 @@ function session_error_handling_function($code, $msg, $file, $line) {
// update $root_url based on user specific directories
if (isset($_SESSION[FM_SESSION_ID]['logged']) && !empty($directories_users[$_SESSION[FM_SESSION_ID]['logged']])) {
$wd = fm_clean_path(dirname($_SERVER['PHP_SELF']));
- $root_url = $root_url.$wd.DIRECTORY_SEPARATOR.$directories_users[$_SESSION[FM_SESSION_ID]['logged']];
+ $root_url = $root_url . $wd . DIRECTORY_SEPARATOR . $directories_users[$_SESSION[FM_SESSION_ID]['logged']];
}
// clean $root_url
$root_url = fm_clean_path($root_url);
@@ -273,20 +275,21 @@ function session_error_handling_function($code, $msg, $file, $line) {
// logout
if (isset($_GET['logout'])) {
unset($_SESSION[FM_SESSION_ID]['logged']);
- unset( $_SESSION['token']);
+ unset($_SESSION['token']);
fm_redirect(FM_SELF_URL);
}
// Validate connection IP
if ($ip_ruleset != 'OFF') {
- function getClientIP() {
+ function getClientIP()
+ {
if (array_key_exists('HTTP_CF_CONNECTING_IP', $_SERVER)) {
return $_SERVER["HTTP_CF_CONNECTING_IP"];
- }else if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {
+ } else if (array_key_exists('HTTP_X_FORWARDED_FOR', $_SERVER)) {
return $_SERVER["HTTP_X_FORWARDED_FOR"];
- }else if (array_key_exists('REMOTE_ADDR', $_SERVER)) {
+ } else if (array_key_exists('REMOTE_ADDR', $_SERVER)) {
return $_SERVER['REMOTE_ADDR'];
- }else if (array_key_exists('HTTP_CLIENT_IP', $_SERVER)) {
+ } else if (array_key_exists('HTTP_CLIENT_IP', $_SERVER)) {
return $_SERVER['HTTP_CLIENT_IP'];
}
return '';
@@ -297,21 +300,21 @@ function getClientIP() {
$whitelisted = in_array($clientIp, $ip_whitelist);
$blacklisted = in_array($clientIp, $ip_blacklist);
- if($ip_ruleset == 'AND'){
- if($whitelisted == true && $blacklisted == false){
+ if ($ip_ruleset == 'AND') {
+ if ($whitelisted == true && $blacklisted == false) {
$proceed = true;
}
} else
- if($ip_ruleset == 'OR'){
- if($whitelisted == true || $blacklisted == false){
+ if ($ip_ruleset == 'OR') {
+ if ($whitelisted == true || $blacklisted == false) {
$proceed = true;
}
}
- if($proceed == false){
+ if ($proceed == false) {
trigger_error('User connection denied from: ' . $clientIp, E_USER_WARNING);
- if($ip_silent == false){
+ if ($ip_silent == false) {
fm_set_msg(lng('Access denied. IP restriction applicable'), 'error');
fm_show_header_login();
fm_show_message();
@@ -327,7 +330,7 @@ function getClientIP() {
} elseif (isset($_POST['fm_usr'], $_POST['fm_pwd'], $_POST['token'])) {
// Logging In
sleep(1);
- if(function_exists('password_verify')) {
+ if (function_exists('password_verify')) {
if (isset($auth_users[$_POST['fm_usr']]) && isset($_POST['fm_pwd']) && password_verify($_POST['fm_pwd'], $auth_users[$_POST['fm_usr']]) && verifyToken($_POST['token'])) {
$_SESSION[FM_SESSION_ID]['logged'] = $_POST['fm_usr'];
fm_set_msg(lng('You are logged in'));
@@ -344,21 +347,22 @@ function getClientIP() {
// Form
unset($_SESSION[FM_SESSION_ID]['logged']);
fm_show_header_login();
- ?>
+?>