With this File Manager prepared for PHP/Js, you can perform all file operations on your server without any problems.

Overview

FileManager

With this File Manager prepared for PHP/Js, you can perform all file operations on your server without any problems.


Instead of downloading and integrating the file manager I need in the projects I prepared, I decided to create both OOP experience and my own PHP FileManager class and a visual interface that I can use in this class.

Contrary to the standards, I do the version notification using the following method so that it is clear what content I am using during a possible change in the future.


Version features;


  • In FileManager.php v2 I used the FMP namespace and the fmp class name to further reduce the code complexity found in v1.
  • Unlike the previous version, in this version, graphic files are previewed with the "tempImage()" function in the class instead of standard icons.
  • Quick access thanks to the folder tree, which can be used on a screen with a resolution of 640px and above for ease of use.
  • Popup menus with customized jQuery-ui plugin
  • Multi-language support with xml format
  • Built-in FontAwesome 4 icons
  • The interface will not work without jQuery and console.log() will create a record
  • With the "config.xml" file, the root directory, color scheme and maximum file upload size can be specified.

FMP class in FileManager.php;


  1. First of all, I had to redefine functions such as mime_content_type() and realpath() in the class in order not to cause software errors between possible PHP versions.
  2. fmp->post($_POST variable)
    To be able to use the posted data securely. Returns "false" if the value is undefined/empty, otherwise returns the posted data.
  3. fmp->tempImage(imageLocation,desiredType,tempFolder)
    If there is no image sent in the specified tempFolder, it will be reduced to 45px*45px and saved in the tempFolder with a new name in md5() format. Returns null if imageLocation is not found, otherwise returns with image content
  4. fmp->details(adress)
    type(text file), graphic(true/false), server location(/home/dir/), web location(/dir), size( Returns 1mb), edit date(Ynd H:i:sa), and privacy(777)
  5. fmp->create(name,path,type)
    Creates the desired name and type (file/folder) at the specified path. Adds a number to the end of the filename if there is content with the same name in the specified path. If there is no error, it returns the name of the created content.
  6. fmp->fileSave(file,content)
    Replaces the contents of the file at the specified address. returns true/false
  7. fmp->listing(folder,requestType
    ) Returns the contents of the specified folder in the desiredType (all, folders only, only files) as an array variable.
  8. fmp->folderList(folder)
    On the contrary, fmp->listing() function returns only the folders in the specified folder in string format with comma marks (,) between them.
  9. fmp->download(file)
    It provides a secure download of the desired file by making the necessary header() definitions.
  10. fmp->delete(files)
    Deletes the file/s sent in both array and string form. Returns deleted and non-deletable filenames.
  11. fmp->move(files,movingFolder) Moves files,
    both array and string, to the specified moveFolder. Returns True/False.
  12. fmp->copy(files,copyFolder) Copies
    both array and string files to the specified copyFolder. Returns True/False.
  13. fmp->rename(oldName,newName)
    renames oldName content with newName.
  14. fmp->upload(files, uploadFolder) Uploads
    files sent either as array or string to the upload folder and names them according to the file existence. Returns with array elements named Error and done
  15. fmp->createZip(files,creationFolder)
    Creates a zip archive with both array and string files, in the specified creationFolder. It returns array elements named Error and done.
  16. fmp->unZip(archiveFile,folder)
    Extracts the specified archiveFile in the desired directory. Returns True/False.
  17. In case of a possible error in all operations , the error date, operation and necessary information are recorded in the "/manager/fm_error_log.txt" file.

You might also like...

This is a simple web application of a To-do List in which you can add, remove and edit all your tasks and also you can mark each task as completed and delete all completed ones.

To-Do List A simple web application of a to do list Built With HTML, CSS, JS, ES6 & Webpack Getting Started In this repository I created To-Do List SP

Apr 11, 2022

Calculating Pi number without limitation until 10k digits or more in your browser powered by JS without any third party library!

Calculating Pi number without limitation until 10k digits or more in your browser powered by JS without any third party library!

PI Calculator Web JS (Online) Calculating Pi number without limitation until 10k digits or more in your browser powered by JS without any third party

Jul 27, 2022

A crawler that crawls the site's internal links, fetching information of interest to any SEO specialist to perform appropriate analysis on the site.

Overview 📝 It is a module that crawls sites and extracts basic information on any web page of interest to site owners in general, and SEO specialists

Apr 22, 2022

A crawler that crawls the site's internal links, fetching information of interest to any SEO specialist to perform appropriate analysis on the site.

Overview 📝 It is a module that crawls sites and extracts basic information on any web page of interest to site owners in general, and SEO specialists

Apr 22, 2022

Debug express.js server code with Ray to fix problems faster

Debug express.js server code with Ray to fix problems faster

express-ray Install this package in any Express.js project to provide an exceptional debugging experience using the Ray app by Spatie. Installation In

Nov 3, 2022

Hacktoberfest is all about meeting up all brains. In this repository we are planning to come with many ideas and works. You all can share your ides/works here.

Hacktoberfest is all about meeting up all brains. In this repository we are planning to come with many ideas and works. You all can share your ides/works here.

Hacktoberfest Submit your Work Hacktoberfest is all about meeting up all brains. In this repository we are planning to come with many ideas and works.

Oct 5, 2022
Comments
  • Vulnabilities

    Vulnabilities

    Exists ton of vulnabilities.

    1. saveFile has remote file injection
    2. download has remote file download ( i had downloaded your /etc/passwd and login with your FTP )
    opened by illegal-instruction-co 2
This is a project that is used to execute python codes in the web page. You can install and use it in django projects, You can do any operations that can be performed in python shell with this package.

Django execute code This is a project that is used to execute python codes in the web page. You can install and use it in django projects, You can do

Shinu 5 Nov 12, 2022
A status monitor for Elite Dangerous, written in PHP. Designed for 1080p screens in the four-panel-view in panel.php, and for 7 inch screens with a resolution of 1024x600 connected to a Raspberry Pi.

EDStatusPanel A status monitor for Elite Dangerous, written in PHP. Designed for 1080p screens in the four-panel-view in panel.php, and for 7 inch scr

marcus-s 24 Oct 4, 2022
caniuse.com but for PHP - a searchable list of new and deprecated features in recent PHP versions

caniphp.com caniphp.com is like caniuse.com but for PHP features. It's a simple search of PHP features that added, deprecated and removed in recent ve

Ross Wintle 95 Dec 25, 2022
a VS Code Extension for Easily Localize any blade/php text in any Laravel project.

Laravel Easy Localize a VS Code Extension for Easily Localize any blade/php text in any Laravel project. Features Custom array key for each translatio

Moataz Hajres 6 Oct 31, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
PHP Version Manager, for Windows

PHP Version Manager CLI to manage PHP versions, created for Windows. Before Install If PHP is already installed, it is recommended that you remove it.

Caio Teixeira 7 Aug 23, 2022
A bbg website manager based on php.

php_admin_srcfile php编写的试验性的bbg博客管理后台。 此目录下的内容现在不是,以后也不会是 BBG 桌面版管理程序的一部分。此目录下的内容(未来)可能的用途是在有PHP环境的服务器上提供一种管理 BBG 生成的博客站点的简单方法。 注意:此目录下的内容目前未经过安全审计和充分

BBG Contributors 2 Jul 4, 2022
A devtool improve your pakage manager use experience no more care about what package manager is this repo use; one line, try all.

pi A devtool improve your pakage manager use experience no more care about what package manager is this repo use; one line, try all. Stargazers over t

tick 11 Nov 1, 2022