PHPackages                             patroklo/octobercms-improved-fileupload - 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. patroklo/octobercms-improved-fileupload

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

patroklo/octobercms-improved-fileupload
=======================================

Improves October CMS file upload form widget options with user defined rules.

v1.2.1(10y ago)114.5k↓68.8%1MITPHPPHP &gt;=5.4

Since May 13Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Patroklo/octobercms-improved-fileupload)[ Packagist](https://packagist.org/packages/patroklo/octobercms-improved-fileupload)[ Docs](https://github.com/Patroklo/OctoberCms-improved-fileupload)[ RSS](/packages/patroklo-octobercms-improved-fileupload/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

OCTOBER CMS IMPROVED FILE UPLOAD FORM WIDGET
============================================

[](#october-cms-improved-file-upload-form-widget)

A simple extension for the October CMS's FileUpload form widget that lets the addition of user defined rules in the form YAML config files or the models where the field is declared.

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

[](#installation)

Manually from your terminal typing:

```
$ composer require patroklo/octobercms-improved-fileupload
```

Or add this to your project's `composer.json` file:

```
"patroklo/octobercms-improved-fileupload": "*"
```

And it's done!

New image mode
--------------

[](#new-image-mode)

There's a new mode in the form widget called `image-multi-big`. When activated, it will make bigger images when uploading them than the standar multiupload.

To activate this mode you only have to declare it in the yaml file:

```
fields:
  // ...
  images:
    tab: Tab text
    label: Label text
    type: Patroklo\FormWidgets\FileUpload
    mode: image-multi-big
  // ...

```

New Rules
---------

[](#new-rules)

There are an additional set of rules developed to increase the performance of the form system:

### maxFiles:\[number\]

[](#maxfilesnumber)

This rule must only be used in this form widget.

It checks the number of uploaded files linked into this model and, if it's more than the defined number, will throw an error and stop the upload.

Configuration
-------------

[](#configuration)

\### Add the form widget into your YAML config form files:

Since this is not a default form widget the better way to do this is declaring the class full namespace:

```
fields:
  // ...
  images:
    tab: Tab text
    label: Label text
    type: Patroklo\FormWidgets\FileUpload
    mode: image
  // ...

```

And now you can use the form widget as is it was the default version of FileUpload.

User defined rules
------------------

[](#user-defined-rules)

The rules are the very same that are used in the Validation library, with additional ones defined in the [New Rules](#new_rules) section.

If you want to use user defined upload rules, there are two different ways to accomplish this: add a YAML option in the form config file or a method into the method class.

The YAML config file will have priority over the model's method one, so if you have both defined at the same time, it will be applied the YAML one.

### Adding the rules into the YAML config file:

[](#adding-the-rules-into-the-yaml-config-file)

```
fields:
  // ...
  images:
    tab: Tab text
    label: Label text
    type: Patroklo\FormWidgets\FileUpload
    mode: image
    rules: required|image|maxFiles:5|max:1024
  // ...

```

### Adding the rules into a model's method

[](#adding-the-rules-into-a-models-method)

You can add a new method into the model that holds the attribute where you can add your files that will store all it's rules.

This way of adding rules has the benefit of allowing dynamic rules.

```
class User extends Model {

    ...

    public $attachMany = [
        'images' => 'System\Models\File'
    ];

    /**
     * File upload rules
     * @return array
     */
    public function fileUploadRules()
    {
        return ['images' => 'required|image|maxFiles:5|max:1024'];
    }
```

And that's all folks! Any question or idea you have will be welcomed!

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

4

Last Release

3696d ago

### Community

Maintainers

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

---

Top Contributors

[![Patroklo](https://avatars.githubusercontent.com/u/1254017?v=4)](https://github.com/Patroklo "Patroklo (9 commits)")

---

Tags

uploadFormsoctober cmsform widget

### Embed Badge

![Health badge](/badges/patroklo-octobercms-improved-fileupload/health.svg)

```
[![Health](https://phpackages.com/badges/patroklo-octobercms-improved-fileupload/health.svg)](https://phpackages.com/packages/patroklo-octobercms-improved-fileupload)
```

###  Alternatives

[vich/uploader-bundle

Ease file uploads attached to entities

1.9k27.6M142](/packages/vich-uploader-bundle)[unclecheese/dropzone

An HTML5 upload field for the CMS and frontend forms.

47131.5k6](/packages/unclecheese-dropzone)[marrouchi/upload-crop-image-bundle

Basic server side cropping behavior for Symfony2

121.1k](/packages/marrouchi-upload-crop-image-bundle)

PHPackages © 2026

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