📜 ⬆️ ⬇️

PHP file manager, with rights, version control and AJAX

File Manager Features:
- You can set permissions on files and directories. Rights of two types: have access or not access. Files are stored in a folder inaccessible for direct download. The file is downloaded with a preliminary check of the user and access rights to the file. Any user of the file manager may have administrative rights, which is indicated when adding a new user or editing an existing user. The administrator can see everything, including the "deleted" files.
- Version control of each file. After a file is downloaded, it is saved with a name that does not allow overwriting existing files, and its “original” name is saved in the database. This approach allows you to store different file states.
- Automatic creation of previews of downloaded images.
- File in the manager can be made available for download.
- GPL, code available on github




')
FM created without the use of frameworks. This is a fairly common MVC application, where the main controller actions can be triggered by an AJAX request, for example:
- when the application is initialized, the AJAX controller / ajax / fm /? Action = files is called, the files () function, depending on the current directory stored in the session, receives a list of files and directories.
- clicking on the file makes the DIV active with id = “fDialog”, and depending on the selected tab of the dialog box, receives the necessary data for the current file.

Following the link you can learn the basics of the application.

To upload files using Ajax Upload . It supports multi-boot and allows you to upload files by dragging and dropping them to the “File Download” button. Main disadvantage: Ajax Upload does not work on tablet (Android) devices.

Installation:
1) Download the github file manager code
2) Create a database and user to access the database. The dump is stored in the /sql/fm.sql folder
3) Unpack the source code of the system in any directory of the web server
4) Set write permissions for the required directories:
/ cache / / upload / / upload / _thumb /

5) Edit the file /system/config.ini:
; enable caching, speeds up the execution of php scripts
twig_cache = false

; the paths used by the system do not need to be changed
[path]
application = "/ system /"
library = "/ system / library /"
controller = "/ system / Controller /"
templates = "/ system / View / templates /"
layouts = "/ system / View / layouts /"
cache = "/ cache"
upload = "upload /"

[fm]
; maximum file size in bytes
sizeLimit = 10485760
; background color for created thumbnails and JPEG compression quality
rgb = 0xFFFFFF
quality = 100

; parameters for accessing the database
; because PDO can be used can use other databases
[db]
adapter = "mysql"
host = "localhost"
username = ""
password = ""
dbname = ""
6) Open the file manager in the browser. To enter filemanager / filemanager
Login / password of the user with administrator rights

1) Ajax Upload
valums.com/ajax-upload/
2) File type icons: OSX 3.3

PS In the demo file manager can not make any changes. ReadOnly, this is special.
The file manager interface is quite simple; if the project is interesting, I promise to work on the interface.

Source: https://habr.com/ru/post/138512/


All Articles