PHPackages                             dheeyi/ud-files - 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. dheeyi/ud-files

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

dheeyi/ud-files
===============

Handling Files. Multiple file upload with PHP and MySQL - Uploading and Downloading

018PHP

Since Sep 25Pushed 8y ago1 watchersCompare

[ Source](https://github.com/dheeyi/ud-files)[ Packagist](https://packagist.org/packages/dheeyi/ud-files)[ RSS](/packages/dheeyi-ud-files/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Multiple file upload with PHP and MySQL - Uploading and Downloading
===================================================================

[](#multiple-file-upload-with-php-and-mysql---uploading-and-downloading)

This small example shows how to upload and download files in PHP.

It's recommended that you use Composer to install UDFiles.
----------------------------------------------------------

[](#its-recommended-that-you-use-composer-to-install-udfiles)

Run this command from the directory in which you want to install your new UDFiles application.

```
composer require dheeyi/ud-files dev-master

```

That's! Now go upload and download files.

Usage
-----

[](#usage)

### Config default data \[settings.php\]

[](#config-default-data-settingsphp)

```
return [
    'settings' => [
        // Directory uploaded settings
        'upload_path' => __DIR__ . '/../files',

        // Database settings
        'database' => [
                'driver' => 'mysql',
                'host' => '127.0.0.1',
                'database' => 'cegos',
                'username' => 'root',
                'password' => 'sample',
                'collation' => 'utf8_general_ci',
                'prefix' => ''
        ],

        // Name App settings
        'nameApp' => 'Upload Files in PHP',
        // Display erros settings
        'displayErrors' => false,
    ],
];

```

### Config App \[init App\]

[](#config-app-init-app)

```
require __DIR__ . '/../vendor/autoload.php';

use UDFiles\App\App;
use UDFiles\FileManager\File;

/**
 * Initialize the App
 * Basic Example Usage
 * Default parameters must be declared (settings.php)
 */
$settings = require __DIR__ . '/../src/settings.php';
$app = new App($settings);

```

### Create Instance Class \[File\]

[](#create-instance-class-file)

```
/**
 * Create an instance of class File
 */
$file = new File($_FILES['file']);

```

### Usage methods \[functions example\]

[](#usage-methods-functions-example)

```
/**
 * Default validations are disabled ['validateExtension' => false, 'validateSize' => false, 'size' => '0'];
 * Default Extensions ['jpeg', 'jpg', 'png', 'pdf', 'txt'];
 *
 * If we want to add a new extension
 * $file->addExtension('png'); or $file->setExtensions(['pdf', 'jpg']);
 */
$file->setValidate(['validateExtension' => true, 'validateSize' => true, 'size' => 100000]);

//Set the directory where files are uploaded
$file->setPathUpload($app->getSetting('upload_path'));

//Upload File
$file->uploadFile($file->getFileName());

//Move de file to other directory
$file->moveFile($file->getFileName(), '/opt/goo/UDFiles/classes');

//Set new directory where files are uploaded
$file->setPathUpload('/opt/goo/UDFiles/classes');

//Rename File
$file->renameFile($file->getFileName(), '/opt/goo/UDFiles/classes/newname.pdf');

//Download File
$file->downloadFile($file->getFileName());

//Download File Inline
$file->downloadFileInline($file->getFileName(), 'application/pdf', true, '/opt/goo/UDFiles/classes');

//Delete File
$file->deleteFile($file->getFileName());

//Move File
$file->moveFile($file->getFileName(), '/opt/goo/UDFiles/classes');

//Delete File (send new path directory)
$file->deleteFile($file->getFileName(), '/opt/goo/UDFiles/classes');

```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1191f7271d8954ec25079b9f6529d9f45cc69d2129e2bd07b0bbed8d8b38e958?d=identicon)[dheeyi](/maintainers/dheeyi)

---

Top Contributors

[![dheeyi](https://avatars.githubusercontent.com/u/7713859?v=4)](https://github.com/dheeyi "dheeyi (6 commits)")

### Embed Badge

![Health badge](/badges/dheeyi-ud-files/health.svg)

```
[![Health](https://phpackages.com/badges/dheeyi-ud-files/health.svg)](https://phpackages.com/packages/dheeyi-ud-files)
```

###  Alternatives

[venveo/craft-compress

Create smart zip files from Craft assets on the fly

124.7k](/packages/venveo-craft-compress)

PHPackages © 2026

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