PHPackages                             amplie-solucoes/ezfile - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. amplie-solucoes/ezfile

ActiveLibrary[File &amp; Storage](/categories/file-storage)

amplie-solucoes/ezfile
======================

Easy and Simple Filemanager

2.5(10mo ago)1340MITPHPPHP &gt;=7.0

Since Feb 28Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/rafaellopes21/EzFile)[ Packagist](https://packagist.org/packages/amplie-solucoes/ezfile)[ Docs](https://ampliesolucoes.com.br)[ RSS](/packages/amplie-solucoes-ezfile/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (1)Versions (11)Used By (0)

EzFile - Easy and Simple Filemanager
====================================

[](#ezfile---easy-and-simple-filemanager)

EzFile is a free, nonprofit PHP library designed to simplify file and directory manipulation in web development. With a focus on ease of use, it provides efficient tools for common tasks like creating, renaming, moving, copying, deleting, uploading, downloading and manipulating files and folders. The EzFile accelerates web development, making it easier to work with files and directories and enhancing productivity.

Requirements
------------

[](#requirements)

ToolVersionRequirementPHP7.0 or HigherRequiredInstallation
------------

[](#installation)

Install EzFile using Composer:

```
composer require amplie-solucoes/ezfile
```

Note
----

[](#note)

If you need to work with handling files that will be large in size, make sure to change the following parameters in your php.ini file:

- memory\_limit
- upload\_max\_filesize
- post\_max\_size

How to Use
----------

[](#how-to-use)

The objective of EzFile is to be a simple and easily accessible library, therefore, all the code was designed to be executed statically, facilitating the work and manipulation of the code.

Additionally, it's crucial to note that each of the functions listed below includes a parameter named "force." This parameter serves the purpose of enabling the manipulation of files located beyond the designated main path. Please refer to the examples provided for clarity:

---

##### Exists Function

[](#exists-function)

```
//Validate if a Directory or File exists
EzFile::exists('your_path');

//Using 'allowOutsidePath' paramn to prevent a validation outsite main path
EzFile::exists('your_path', true);

/*
====== [ Function Return ] =====
EXISTS: true
NOT EXISTS: false
*/
```

---

##### Create Function

[](#create-function)

```
//Create a Directory or File
EzFile::create('your_path');

//Create a Directory or File replacing special chars and set all to lowercase
EzFile::create('your_path', true);

//Using 'allowOutsidePath' paramn to prevento to create outsite main path
EzFile::create('your_path', false, true);

/*
====== [ Function Return ] =====
SUCCESS: true
ERROR: ['error' => true, 'message' => 'error_message']
*/
```

---

##### Write Function

[](#write-function)

```
//Write a file replacing the content (the function will create the file if not exist)
EzFile::write('your_file_path', 'any_content_you_want');

//using 'replaceContent' as FALSE, to append the content at the end of file.
EzFile::write('your_file_path', 'any_content_you_want', false);

//Using 'allowOutsidePath' paramn to prevent to write in a file outsite main path
EzFile::write('your_file_path', 'any_content_you_want', false, true);

/*
====== [ Function Return ] =====
SUCCESS: true
ERROR: ['error' => true, 'message' => 'error_message']
*/
```

---

##### Read Function

[](#read-function)

```
//Read the file that you want
EzFile::read('your_file_path');

//Using 'allowOutsidePath' paramn to prevent to read a file outsite main path
EzFile::read('your_file_path', true);

/*
====== [ Function Return ] =====
SUCCESS: *The File Content*
ERROR: ['error' => true, 'message' => 'error_message']
*/
```

---

##### Rename Function

[](#rename-function)

```
//Rename a Directory or File
EzFile::rename('current_path', 'renamed_path');

//Rename a Directory or File replacing special chars and set all to lowercase
EzFile::rename('current_path', 'renamed_path', true);

//Using 'allowOutsidePath' paramn to prevent to rename outsite main path
EzFile::rename('current_path', 'renamed_path', false, true);

/*
====== [ Function Return ] =====
SUCCESS: true
ERROR: ['error' => true, 'message' => 'error_message']
*/
```

---

##### Move Function

[](#move-function)

```
//Move a Directory or File
EzFile::move('current_path', 'move_path');

//Using 'allowOutsidePath' paramn to prevent to move outsite main path
EzFile::move('current_path', 'move_path', true);

/*
====== [ Function Return ] =====
SUCCESS: true
ERROR: ['error' => true, 'message' => 'error_message']
*/
```

---

##### Copy Function

[](#copy-function)

```
//Copy a Directory (and all contents inside) or File
EzFile::copy('current_path', 'copy_path');

//Using 'allowOutsidePath' paramn to prevent to copy outsite main path
EzFile::copy('current_path', 'copy_path', true);

/*
====== [ Function Return ] =====
SUCCESS: true
ERROR: ['error' => true, 'message' => 'error_message']
*/
```

---

##### Change Path Permissions Function

[](#change-path-permissions-function)

```
//Permission code set in a Directory or File
EzFile::changePermissions('your_path', 0777);
EzFile::changePermissions('your_path', 0666);
EzFile::changePermissions('your_path', 0700);
//... and other codes that you need

//Using 'allowOutsidePath' paramn to prevent to change permissions outsite main path
EzFile::changePermissions('your_path', 0777, true);

/*
====== [ Function Return ] =====
SUCCESS: true
ERROR: ['error' => true, 'message' => 'error_message']
*/
```

---

##### Pathinfo Function

[](#pathinfo-function)

```
//Info of the Directory or File
EzFile::pathInfo('your_path');

//Using 'allowOutsidePath' paramn to prevent to get pathinfo outsite main path
EzFile::pathInfo('your_path', true);

/*
====== [ Function Return ] =====
SUCCESS: [array_with_all_informations_that_you_need]
ERROR: ['error' => true, 'message' => 'error_message']
*/
```

---

##### List Function

[](#list-function)

```
//List a Directory
EzFile::list('your_path');

//Using 'allowOutsidePath' paramn to prevent to list outsite main path
EzFile::list('your_path', true);

/*
====== [ Function Return ] =====
SUCCESS: [array_with_all_informations_that_you_need]
ERROR: ['error' => true, 'message' => 'error_message']
*/
```

---

##### Zip Folder Function

[](#zip-folder-function)

```
//Zip a Directory with all contents inside
EzFile::zip('your_folder_path', 'zip_path');

//Using 'allowOutsidePath' paramn to prevent to zip outsite main path
EzFile::zip('your_folder_path', 'zip_path', true);

/*
====== [ Function Return ] =====
SUCCESS: true
ERROR: ['error' => true, 'message' => 'error_message']
*/
```

---

##### Unzip Folder Function

[](#unzip-folder-function)

```
//Unzip a file with all contents inside (ONLY ZIP FILES)
EzFile::unzip('your_zip_file_path', 'unzip_path');

//Using 'allowOutsidePath' paramn to prevent to unzip outsite main path (ONLY ZIP FILES)
EzFile::unzip('your_zip_file_path', 'unzip_path', true);

/*
====== [ Function Return ] =====
SUCCESS: true
ERROR: ['error' => true, 'message' => 'error_message']
*/
```

---

##### Delete Function

[](#delete-function)

```
//Delete a Directory (and all contents inside) or File
EzFile::delete('your_path');

//Using 'allowOutsidePath' paramn to prevent to delete outsite main path
EzFile::delete('your_path', true);

/*
====== [ Function Return ] =====
SUCCESS: true
ERROR: ['error' => true, 'message' => 'error_message']
*/
```

---

##### Upload Function

[](#upload-function)

```
//Upload a Directory (and all contents inside) or File(s)
EzFile::upload('upload_path', $_FILES);

//Uploading and renaming (the lib will interate automatically as new_name_1... new_name_2....)
EzFile::upload('upload_path', $_FILES, 'new_name');

//Uploading accept only files with
EzFile::upload('upload_path', $_FILES, false, ['txt', 'png', 'json', /* ... */]);

//Using 'allowOutsidePath' paramn to prevent to Upload outsite main path
EzFile::upload('upload_path', $_FILES, false, [], true);

/*
====== [ Function Return ] =====
SUCCESS: ['success' => [], 'fail' => [], 'denied' => []]
ERROR: ['error' => true, 'message' => 'error_message']
*/
```

---

##### Download Function

[](#download-function)

```
//Download a Directory (and all contents inside) or File
EzFile::download('your_path');

//Using 'allowOutsidePath' paramn to prevent to download outsite main path
EzFile::download('your_path', true);

/*
====== [ Function Return ] =====
SUCCESS: The user will receive the download item
ERROR: ['error' => true, 'message' => 'error_message']
*/
```

---

##### Computational Units Const

[](#computational-units-const)

```
// Get size unit constants
EzFile::UNIT_BYTES;      //Return (string): "B"
EzFile::UNIT_KILOBYTES;  //Return (string): "KB"
EzFile::UNIT_MEGABYTES;  //Return (string): "MB"
EzFile::UNIT_GIGABYTES;  //Return (string): "GB"
EzFile::UNIT_TERABYTES;  //Return (string): "TB"
EzFile::UNIT_PETABYTES;  //Return (string): "PB"
EzFile::UNIT_EXABYTES;   //Return (string): "EB"
EzFile::UNIT_ZETTABYTES; //Return (string): "ZB"
EzFile::UNIT_YOTTABYTES; //Return (string): "YB"
```

---

##### Units Format Function

[](#units-format-function)

```
// Format the value for human reading

//Formatting bytes Value
EzFile::sizeUnitFormatter(100); //Return (string): 100 B

//Formatting by setting computational unit
EzFile::sizeUnitFormatter(5, EzFile::UNIT_GIGABYTES);   //Return (string): 5 GB
EzFile::sizeUnitFormatter(500, EzFile::UNIT_GIGABYTES); //Return (string): 500 GB
EzFile::sizeUnitFormatter(1, EzFile::UNIT_TERABYTES);   //Return (string): 1 TB

//Formatting by setting computational unit with data in byte number
EzFile::sizeUnitFormatter(1, EzFile::UNIT_TERABYTES, true); //Return (string): 1099511627776 B

/*
====== [ Function Return ] =====
SUCCESS: Return a string value
ERROR: ['error' => true, 'message' => 'error_message']
*/
```

Example of Code
---------------

[](#example-of-code)

See below a simple example of how to work with some functions

```
//Import the lib
use AmplieSolucoes\EzFile\EzFile;

//Example Creating a file/Directory
$ezFile = EzFile::create('your_path');
if(isset($ezFile['error'])){
    // Ops, errors found... put your code logic here with message $ezFile['message']
} else {
    // It Worked
}

//Example renaming a file/Directory
$ezFile = EzFile::rename('current_path', 'renamed_path');
if(isset($ezFile['error'])){
    // Ops, errors found... put your code logic here with message $ezFile['message']
} else {
    // It Worked
}

//Example getting the pathinfo from file/Directory
$ezFile = EzFile::pathInfo('your_path');
if(isset($ezFile['error'])){
    // Ops, errors found... put your code logic here with message $ezFile['message']
} else {
    // It Worked, get all data from the array $ezFile
}

//Example uploading file(s)/Directory(ies)
$ezFile = EzFile::upload('upload_path', $your_files_in_array);
if(isset($ezFile['error'])){
    // Ops, errors found... put your code logic here with message $ezFile['message']
} else {
    // It Worked, get all data from the array $ezFile
}

//Example writing file(s)
$ezFile = EzFile::write('file_path_name_with_extension', 'any_content');
if(isset($ezFile['error'])){
    // Ops, errors found... put your code logic here with message $ezFile['message']
} else {
    // It Worked
}
```

---

\* Important \*
---------------

[](#-important-)

If "*path*" paramn send has errors, all the functions above will return an array:

```
['error' => true, 'message' => 'error_message']
```

Tests
-----

[](#tests)

- All the tests can be found in *EzFile/tests/EzFileTest.php*
- Run the tests by typing in console

```
./vendor/bin/phpunit tests/ --colors=always
```

Donate
------

[](#donate)

If you find this project helpful and valuable, please consider supporting me. Your contribution help me to maintain and improve this library for everyone use with no cost. Every little bit helps!

[Donate Here](https://nubank.com.br/pagar/5th42/1efRKgR2V8)

Thank you for your generosity and support! 🙏

---

This README provides an overview of the EzFile library, its features, and how to use it. Adjustments can be made as needed to fit your specific project.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance54

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~59 days

Recently: every ~127 days

Total

10

Last Release

318d ago

Major Versions

1.0.3 → 2.02024-03-20

PHP version history (2 changes)1.0.0PHP ^7.0 || ^8.0

2.4PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd0e413b49505aa456c4f6b9b75749d83635cd16b018d245ea0631748301dc6e?d=identicon)[ampliesolucoes](/maintainers/ampliesolucoes)

---

Top Contributors

[![rafaellopes21](https://avatars.githubusercontent.com/u/57456158?v=4)](https://github.com/rafaellopes21 "rafaellopes21 (20 commits)")

---

Tags

phpcomposerlibraryfilemanagerdirectoryuploadfile managerfolderfilemanagerfile-uploadPHP Librarylibopen-sourceutility-librarydevelopment-toolsweb-developmentphp utilitiesphp developmentphp file managerfile-handlingcode managementmedia mangerPHP file managementDirectory manipulationOpen source projectFile organizationFilesystem operations

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/amplie-solucoes-ezfile/health.svg)

```
[![Health](https://phpackages.com/badges/amplie-solucoes-ezfile/health.svg)](https://phpackages.com/packages/amplie-solucoes-ezfile)
```

###  Alternatives

[servocoder/richfilemanager

RichFilemanager - highly customizable open-source file manager

90963.7k2](/packages/servocoder-richfilemanager)[mafftor/laravel-file-manager

The file manager intended for using Laravel with CKEditor / TinyMCE / Colorbox

3519.5k](/packages/mafftor-laravel-file-manager)[itskodinger/midia

Simple Media manager for your Laravel project

1416.0k](/packages/itskodinger-midia)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
