PHPackages                             vista-php/upload - 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. vista-php/upload

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

vista-php/upload
================

Upload files library

1.0.3(1y ago)151MITPHPPHP ^8.3

Since Mar 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/vista-php/upload)[ Packagist](https://packagist.org/packages/vista-php/upload)[ RSS](/packages/vista-php-upload/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (5)Used By (0)

VISTA PHP Upload Module
=======================

[](#vista-php-upload-module)

Introduction
------------

[](#introduction)

Vista PHP Upload module is a part of Vista PHP Framework, but can also be used as a stand alone file manipulation package for PHP. It is designed to simplify file uploads and file manipulation in PHP.

Getting Started
---------------

[](#getting-started)

### Installation

[](#installation)

```
composer require vista-php/upload
```

### Usage

[](#usage)

All you need to do is instantiate the `Vista\Upload\FileUploader` class and call the `upload` method. Constructor of the FileUploader class takes one parameter:

- `string $name` - The name of the file input field in the form.

#### Example:

[](#example)

```
use Vista\Upload\FileUploader;

$uploader = new FileUploader('file');
$uploader->upload();
```

### Configuration

[](#configuration)

You can configure the allowed mime types, maximum file size, upload directory, allow overwrite, file name, file nameprefix, file name suffix, allowed file types and perform manual validation based on the configured criteria.

#### Example:

[](#example-1)

```
use Vista\Upload\FileUploader;

$uploader = new FileUploader('file');
$uploader->setAllowedMimeTypes(['image/jpeg', 'image/png', 'image/gif'])
    ->setMaxFileSize(1024 * 1024); // 1MB
    ->setUploadDirectory(__DIR__ . '/uploads') // It should be a writable directory
    ->setAllowOverwrite(true) // default is false
    ->setFileName('file')
    ->setFileNamePrefix('prefix_')
    ->setFileNameSuffix('_suffix.jpg');

$uploader->upload();
```

If you need manual validation based on defined criteria without actually uploading the file, you can call:

```
$validation = $uploader->validate(); // true or false
```

### Deleting Files

[](#deleting-files)

You can delete files using the `delete` method. It takes the file path as a parameter.

```
use Vista\Upload\FileUploader;

$uploader = new FileUploader();
$success = $uploader->delete(__DIR__ '/path/to/file.jpg'); // returns true or false
```

### Additional Methods

[](#additional-methods)

- `getResults` - Returns the upload results.

```
[
    [
        'filename' => 'file.jpg',
        'destination' => '/path/to/uploads/file.jpg',
    ]
]

```

- `getErrors` - Returns the upload errors.

```
[
    'File type not allowed text/plain',
]

```

- `getOriginalFilename` - Returns the original file name.

```
file.txt

```

- `getOriginalExtension` - Returns the original file extension.

```
txt

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance46

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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 ~0 days

Total

4

Last Release

418d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/24e3df1e6f1f1304c7ba83fbdbb309ee383ca3759d1d19856102e16e0d1177e3?d=identicon)[dusanrajcevic](/maintainers/dusanrajcevic)

---

Top Contributors

[![dusanrajcevic](https://avatars.githubusercontent.com/u/8985071?v=4)](https://github.com/dusanrajcevic "dusanrajcevic (25 commits)")

---

Tags

libraryfilesupload

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vista-php-upload/health.svg)

```
[![Health](https://phpackages.com/badges/vista-php-upload/health.svg)](https://phpackages.com/packages/vista-php-upload)
```

###  Alternatives

[uploadcare/uploadcare-php

Uploadcare PHP integration handles uploads and further operations with files by wrapping Upload and REST APIs.

1022.5M6](/packages/uploadcare-uploadcare-php)[unclecheese/dropzone

An HTML5 upload field for the CMS and frontend forms.

46130.7k6](/packages/unclecheese-dropzone)[floor12/yii2-module-files

Yii2 module to upload and manage files to your models.

1612.4k6](/packages/floor12-yii2-module-files)[erlandmuchasaj/laravel-file-uploader

A simple package to help you easily upload files to your laravel project.

128.7k](/packages/erlandmuchasaj-laravel-file-uploader)[gaspertrix/laravel-backpack-dropzone-field

Add Dropzone support for Laravel Backpack

172.2k](/packages/gaspertrix-laravel-backpack-dropzone-field)

PHPackages © 2026

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