PHPackages                             mvccore/ext-form-field-file - 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. [Framework](/categories/framework)
4. /
5. mvccore/ext-form-field-file

ActiveLibrary[Framework](/categories/framework)

mvccore/ext-form-field-file
===========================

MvcCore - Extension - Form - Field - File - form field input:file to upload file(s) and uploaded files validation.

v5.3.1(9mo ago)133013BSD-3-ClausePHPPHP &gt;=5.4.0

Since Jan 18Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/mvccore/ext-form-field-file)[ Packagist](https://packagist.org/packages/mvccore/ext-form-field-file)[ RSS](/packages/mvccore-ext-form-field-file/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (2)Versions (21)Used By (3)

MvcCore - Extension - Form - Field - File
=========================================

[](#mvccore---extension---form---field---file)

[![Latest Stable Version](https://camo.githubusercontent.com/f4548b31034f2871a699ddf4e0c7bc5d6262647d641868f7ea7f6a3f3297db5b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f537461626c652d76352e332e312d627269676874677265656e2e7376673f7374796c653d706c6173746963)](https://github.com/mvccore/ext-form-field-file/releases)[![License](https://camo.githubusercontent.com/53baed538c1c87a033a212f6f4acce684d36137f8622307643ab25e08118452e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d425344253230332d627269676874677265656e2e7376673f7374796c653d706c6173746963)](https://mvccore.github.io/docs/mvccore/5.0.0/LICENSE.md)[![PHP Version](https://camo.githubusercontent.com/9e923690739211296a00adce5d359999dfa345f80fc1b2e2cfe72c49523ee334/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d2533453d352e342d627269676874677265656e2e7376673f7374796c653d706c6173746963)](https://camo.githubusercontent.com/9e923690739211296a00adce5d359999dfa345f80fc1b2e2cfe72c49523ee334/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d2533453d352e342d627269676874677265656e2e7376673f7374796c653d706c6173746963)

MvcCore form extension with `input` type `file` and file(s) upload validation.

This upload has no backward compatible javascript or flash inside. It's strictly HTML5 with no additional info displaying. You can extend this field to do it.

Installation
------------

[](#installation)

```
composer require mvccore/ext-form-field-file
```

Fields And Default Validators
-----------------------------

[](#fields-and-default-validators)

- `input:file`
    - `Files`
        - **configured by default**
        - validate submitted file or multiple files by checking:
            - build in PHP upload errors (max. POST size atc...)
            - if file is not any system file and if it is realy uploaded file (`is_uploaded_file()`, is\_file()`, `filesize()`)
            - allowed characters in filename, this validator automaticly sanitize uploaded filename every time
            - `accept` attribute with allowed mime types by uploaded file(s) magic bytes (or by extension in `accept` attribute, converted on server side to mime type to check magic bytes)
            - ZIP/TAR.GZ/PNG file bombs

Features
--------

[](#features)

- always server side checked attributes `required`, `disabled` and `readonly`
- all HTML5 specific and global atributes (by [Mozilla Development Network Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference))
- every field has it's build-in specific validator described above
- every build-in validator adds form error (when necessary) into session and than all errors are displayed/rendered and cleared from session on error page, where user is redirected after submit
- any field is possible to render naturally or with custom template for specific field class/instance
- very extensible field classes - every field has public template methods:
    - `SetForm()` - called immediatelly after field instance is added into form instance
    - `PreDispatch()` - called immediatelly before any field instance rendering type
    - `Render()` - called on every instance in form instance rendering process
        - submethods: `RenderNaturally()`, `RenderTemplate()`, `RenderControl()`, `RenderLabel()` ...
    - `Submit()` - called on every instance when form is submitted

Basic Example
-------------

[](#basic-example)

```
$form = (new \MvcCore\Ext\Form($controller))->SetId('demo');
...
$photos = new \MvcCore\Ext\Forms\Fields\Time([
	'name'		=> 'photos',
	'label'		=> 'Add your photos:',
	'accept'	=> 'image/*',
	'maxCount'	=> 5, // max. uploaded photos
	'maxSize'	=> 2097152, // max. 2 MB in binary for one item
]);
...
$form->AddFields($photos);
```

TODO
----

[](#todo)

- implement RAR file bombs detection and bz2 file bombs

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance58

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity57

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

Recently: every ~168 days

Total

20

Last Release

277d ago

### Community

Maintainers

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

---

Top Contributors

[![tomFlidr](https://avatars.githubusercontent.com/u/1833722?v=4)](https://github.com/tomFlidr "tomFlidr (72 commits)")

---

Tags

pluginframeworkHTML5filefilesmvcuploadextensionplug-informinputFormsmultipleextinputswebformmvccore

### Embed Badge

![Health badge](/badges/mvccore-ext-form-field-file/health.svg)

```
[![Health](https://phpackages.com/badges/mvccore-ext-form-field-file/health.svg)](https://phpackages.com/packages/mvccore-ext-form-field-file)
```

PHPackages © 2026

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