File manager with php

3 Best PHP Web-Based File Managers

As a web developer, I know how important it is to have a reliable file manager. If you are not able to use FTP or SSH for file management, there are still ways to manage your files. One great option is to use a web-based file manager for PHP.

PHP is one of the most popular programming languages used for web development, and there are a variety of web-based file managers available to help you manage your files.

This type of file manager is easy to use and provides a range of features, such as allowing you to upload and download files, create and rename directories, and even edit text files.

In this blog post, I’m going to share with you my top three picks for the best PHP web-based file managers. I’ll go over the features of each one and why I think they’re the best. So if you’re looking for a file manager that’s easy to use and reliable, read on to find out which one is right for you!

Simple-File-Mamager

Simple File Manager is a single-file PHP code that allows you to manage files in a folder on your web server. It is easy to use – just copy the index.php file to the folder you want to manage.

It has several advantages, such as being Ajax-based for speed, allowing drag-and-drop file uploads, having a modern and aesthetically pleasing interface, and being usable from an iPad.

It also provides XSRF protection and an optional password for extra security.

  • The library is all in a single file. There are no images, CSS, or JavaScript files.
  • Actions are ajax based so it is fast, but doesn’t break the back button.
  • Drag and drop files to upload is allowable if the folder is writable by the webserver ( chmod 777 www/html/upload )
  • The design is kind of like Dropbox and less like Windows Explorer.
  • It supports Unicode file names.
  • The interface is usable from an iPad
  • XSRF protection, and an optional password.
Читайте также:  Double slash in path python

TinyFileManager

Tiny File Manager is a web-based file manager written in a single PHP file. It is a simple library to manage your files efficiently and easily.

  • It is an open-source, light, and simple library with a mobile-friendly view for touch devices.
  • It offers basic features like Create, Delete, Modify, View, Quick Preview, Download, Copy and Move files, Ajax Upload, the ability to drag & drop, Create folders and files, Compress and Extract files ( zip , tar )
  • File URL can be shown
  • File Editing is supported by Cloud9 IDE with syntax highlighting for over 150 languages.
  • Google/Microsoft doc viewer helps you preview PDF/DOC/XLS/PPT/etc . 25 MB can be previewed with the Google Drive viewer.
  • Backup files and IP blacklist and whitelist
  • Search – Search and filter files using datatable js
  • Exclude folders and files from listing
  • Multi-language(20+) support

FileManager

This one is also a good file manager. It requires PHP 5.2 or higher, a zip extension for zip and unzip actions, and file info, iconv, and mbstring extensions.

The library can be embedded into another script.

Источник

Tiny File Manager

It is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application for storing, editing and managing files and folders online via web browser. The Application runs on PHP 5.5+, a build-in support for managing text files with cloud9 IDE and it supports syntax highlighting for over 150+ languages and over 35+ themes. .

Introduction

This documentation is to help you regarding each step of Installation. Please go through the documentation carefully to understand how this is made and how to configure this properly. Basic PHP knowledge is required to customize this Application. You may learn basics here.

Читайте также:  Переделать массив в строку питон

Requirements

It is a simple, fast and small file manager with single php file. It is also a web code editor. It’ll run either online or locally, on Linux, Windows or Mac based platforms. The only requirement is to have PHP 5.5+ available.

  1. PHP 5.5.0 or higher.
  2. Zip extension for zip and unzip actions.
  3. Fileinfo, iconv and mbstring extensions are strongly recommended.

Be careful while editing the file manager. If not edited properly, the application may break completely.
No support is provided for faulty customization. check issues or create new one here

Getting Started #back to top

This is the fastest way to beginners to start using Tiny File Browser

  1. Download ZIP with latest version from master branch.
  2. Copy tinyfilemanager.php to your website folder and open it with web browser (e.g. http://yoursite/any_path/tinyfilemanager.php) .

User Management#back to top

You only need to open it and use the following credentials (you should change them!)
Admin user: admin/admin@123
Normal user: user/12345

 // Users: array('Username' => 'Password', 'Username2' => 'Password2', . ) $auth_users = array( 'admin' => '$2y$10$axZWlisI..n9xmULN4gbhectUdOpu0z64xb9ysycHQ5ubKYcEY5sW', //admin 'user' => '$2y$10$.mwmDmZH2003EjFobn86QuU3kr6NAmUYAaMVWQdLXYkirie7EJxj6', //12345 'guest' => '$2y$10$a.DMI5sRjAnvhb.8rFAXY.XPSEO/eatVb4qCMmTc2YcxTDKp9xMyC' //guest ); 

To enable/disable authentication set $auth_users to true or false.

 // Auth with login/password (set true/false to enable/disable it) $use_auth = true; //change to false to disable the authentication 

Password

Generate secure password using PHP password_hash() password generator

 $auth_users = array( 'username' => 'REPLACE YOUR GENERATED PASSWORD HERE' ); 

If not able to generate password or facing any issue, than generate password using tinyfilemanager itsef on tinyfilemanager > settings > Generate new password hash or alternative password generator here

Читайте также:  Python asterisk double asterisk

or you can use directly password hash in tinyfilemanager it self

 $auth_users = array( 'username' => password_hash('password here', PASSWORD_DEFAULT) ); 

Readonly users

Set user role as readonly permission and thay don’t have permission to create, edit, delete and upload files

 // Readonly users (usernames array) $readonly_users = array( 'user', 'user1', 'guest' ); 

User Specific Directories

Assign specific directories to each user

 //array('Username' => 'Directory path', 'Username2' => 'Directory path', . ) $directories_users = array( 'admin' => 'root', 'user' => 'root/user-folder', 'guest' => 'root/guest/temp' ); 

Exclude Files & Folders #back to top

Configured files and folders will be excluded from the listing, incase same file/folder in multiple place also excluded

 //Array of files and folders excluded from listing $exclude_items = array( 'my-folder', 'secret-files', 'tinyfilemanger.php', '*.php', '*.js' ); 

Embedding #back to top

Include file manager in another script. Just define FM_EMBED and other necessary constants.

 define('FM_EMBED', true); define('FM_SELF_URL', $_SERVER['PHP_SELF']); require 'path/tinyfilemanager.php'; 

Embeding tiny file manager with bootstrap 4, Demo here

Tiny File Manager Embed with Bootstrap

Settings #back to top

Configure language, Error Reporting and Show Hidden Files on settings page

Tiny File manager Settings

Config Flags #back to top

  • FM_ROOT_PATH — default is $_SERVER[‘DOCUMENT_ROOT’]
  • FM_ROOT_URL — default is ‘http(s)://site.domain/’
  • FM_SELF_URL — default is ‘http(s)://site.domain/’ . $_SERVER[‘PHP_SELF’]
  • FM_ICONV_INPUT_ENC — default is ‘CP1251’
  • FM_USE_HIGHLIGHTJS — default is true; Enable/Disable the code highlight
  • FM_HIGHLIGHTJS_STYLE — default is ‘vs’
  • FM_DATETIME_FORMAT — default is ‘d.m.y H:i’
  • FM_EXTENSION — default is «»; Configure allowed file extensions to upload .i.e: ‘jpg,png,pdf,gif,html,css,js’
  • show_hidden_files — default is false; Show or hide files and folders that starts with a dot
  • $edit_files — default is true; Enable ace.js (https://ace.c9.io/) on view’s page
  • $sticky_navbar — default is true; Enable/Disable fixed navigation top bar
  • $online_viewer — default is true; Google Docs Viewer to view all kinds of office file formats

Источник

Оцените статью