PHPackages                             cgm/zf2-file-upload-examples - 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. cgm/zf2-file-upload-examples

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

cgm/zf2-file-upload-examples
============================

Form file upload examples for Zend Framework 2

1.0.0(13y ago)795.3k43[6 issues](https://github.com/cgmartin/ZF2FileUploadExamples/issues)BSD-3-ClausePHPPHP &gt;=5.3.3

Since Jan 31Pushed 9y ago9 watchersCompare

[ Source](https://github.com/cgmartin/ZF2FileUploadExamples)[ Packagist](https://packagist.org/packages/cgm/zf2-file-upload-examples)[ Docs](https://github.com/cgmartin/ZF2FileUploadExamples)[ RSS](/packages/cgm-zf2-file-upload-examples/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

ZF2 File Upload Examples Module
===============================

[](#zf2-file-upload-examples-module)

[![No Maintenance Intended](https://camo.githubusercontent.com/d904056147052e22d8e1c7f46bb50293ed2aeb4c43ead9a2d0cf7a48b46d0562/687474703a2f2f756e6d61696e7461696e65642e746563682f62616467652e737667)](http://unmaintained.tech/)

A set of form file upload examples to test the new features in the upcoming ZF 2.1 release.

**NOTE:** These examples are only compatible with Zend Framework version **2.1** (or greater).

You can find a good primer on file uploading in the [documentation](http://framework.zend.com/manual/2.1/en/modules/zend.form.file-upload.html).

List of Examples
----------------

[](#list-of-examples)

- Using a single File element.
- Using multiple File elements in a Collection.
- Using a single File element with the HTML5 "multiple" attribute.
- Temporarily save uploaded file(s) until a form is completely valid.
- Using file uploads with the Post-Redirect-Get plugin.
- Using AJAX to upload files and displaying progress with [Session Upload Progress](http://www.php.net/manual/en/session.upload-progress.php) (Requires PHP 5.4).
- Complex example using [Session Upload Progress](http://www.php.net/manual/en/session.upload-progress.php) with a partially valid form (Requires PHP 5.4).

See the [Example Controllers](https://github.com/cgmartin/ZF2FileUploadExamples/tree/master/src/ZF2FileUploadExamples/Controller) for more details.

If there is a use-case for file uploading that you'd like to see and isn't currently included here, please create a GitHub issue.

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

[](#installation)

1. Install the [ZendSkeletonApplication](https://github.com/zendframework/ZendSkeletonApplication).
2. Clone this project into your `./vendor/` directory (or use composer, see below).
3. Enable `ZF2FileUploadExamples` in your `application.config.php` file.
4. Create a `./data/tmpuploads` directory, and make writeable by the webserver.
5. Download the [jQuery Form plugin](https://github.com/malsup/form) into `./public/js/jquery.form.js` (for the Upload Progress example).
6. Navigate to `/file-upload-examples` in your browser to see the list of examples.

You may also need to change/verify these `php.ini` settings:

```
file_uploads = On
post_max_size = 50M
upload_max_filesize = 50M
session.upload_progress.enabled = On
session.upload_progress.freq =  "1%"
session.upload_progress.min_freq = "1"
; Also make certain 'upload_tmp_dir' is writeable
```

### Composer

[](#composer)

```
{
    "require": {
        "cgm/zf2-file-upload-examples": ">=1.0.0"
    }
}
```

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.5% 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

Unknown

Total

1

Last Release

4847d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a690b3690ae2873bc032c971bb39299367b899021ecfb71160f864515cdbe84?d=identicon)[cgmartin](/maintainers/cgmartin)

---

Top Contributors

[![cgmartin](https://avatars.githubusercontent.com/u/490760?v=4)](https://github.com/cgmartin "cgmartin (55 commits)")[![basz](https://avatars.githubusercontent.com/u/143068?v=4)](https://github.com/basz "basz (1 commits)")[![bryant1410](https://avatars.githubusercontent.com/u/3905501?v=4)](https://github.com/bryant1410 "bryant1410 (1 commits)")

### Embed Badge

![Health badge](/badges/cgm-zf2-file-upload-examples/health.svg)

```
[![Health](https://phpackages.com/badges/cgm-zf2-file-upload-examples/health.svg)](https://phpackages.com/packages/cgm-zf2-file-upload-examples)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M123](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M61](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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