Giter Club home page Giter Club logo

zf2fileuploadexamples's Introduction

ZF2 File Upload Examples Module

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.

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 (Requires PHP 5.4).
  • Complex example using Session Upload Progress with a partially valid form (Requires PHP 5.4).

See the Example Controllers 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

  1. Install the 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 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###

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

Screenshot

Example screenshot

zf2fileuploadexamples's People

Contributors

basz avatar cgmartin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.