<commit_before>ZF2 File Upload Examples Module
===============================

A set of form file upload examples in a Zend Framework 2 module.

*NOTE:* Currently only compatible with the [develop ZF2 branch](https://github.com/zendframework/zf2/tree/develop),
and requires the following patches:
[Multi-File Input Filtering](https://github.com/zendframework/zf2/pull/3010),
[Session Progress fixes](https://github.com/zendframework/zf2/pull/3058).


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 PHP5's [Session Upload Progress](http://www.php.net/manual/en/session.upload-progress.php).

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 uploads that you'd like to see and isn't currently included here,
please create a GitHub issue.


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

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

You may also need to change these `php.ini` settings:
```ini
post_max_size = 50M
upload_max_filesize = 50M
session.upload_progress.enabled = On
```


Screenshot
----------
![Example screenshot](http://grab.by/hKOu)<commit_msg>Readme update<commit_after>ZF2 File Upload Examples Module
===============================

A set of form file upload examples in a Zend Framework 2 module.

*NOTE:* Currently only compatible with the [develop ZF2 branch](https://github.com/zendframework/zf2/tree/develop),
and requires the following patches:
[Multi-File Input Filtering](https://github.com/zendframework/zf2/pull/3010),
[Session Progress fixes](https://github.com/zendframework/zf2/pull/3058).


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 PHP5's [Session Upload Progress](http://www.php.net/manual/en/session.upload-progress.php).

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 uploads that you'd like to see and isn't currently included here,
please create a GitHub issue.


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

1. Install the [ZendSkeletonApplication](https://github.com/zendframework/ZendSkeletonApplication)
2. Clone this project into your `./vendor/` directory and enable `ZF2FileUploadExamples` in your
   `application.config.php` file.
3. Create a `./data/tmpuploads` directory, and make writeable by the webserver.
4. Download the [jQuery Form plugin](https://github.com/malsup/form) into
   `./public/js/jquery.form.js` (for the Upload Progress example).
4. 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:
```ini
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
```


Screenshot
----------
![Example screenshot](http://grab.by/hKOu)
{'fraction_non_alphanumeric': 0.12662576687116564, 'fraction_numerical': 0.014233128834355829, 'mean_word_length': 4.523035230352304, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6552095', 'n_tokens_mistral': 1251, 'n_tokens_neox': 1173, 'n_words': 406}