Git Product home page Git Product logo

multifile's Introduction

Overview

Flattr this git repo

MultiFile ($.MultiFile) is a non-obtrusive and crucially non-opinionated plugin for jQuery that helps your users easily select multiple files for upload.

It helps you implement a basic interface to improve the file selection experience of your users whilst providing you, the developer, with 3 simple methods of validation: accepted extensions, maximum number of files and total size.


Server-Side Implementation

This plugin will never deal with the server-side implementation of your upload solution. This plugin will not upload your files. If that's what you want, we recommend you check them out one of the many, many many great tools out there which provide a full solution - with image previews, progress bars and extensive support for many environments (.NET, PHP, Java, etc...).

And remember..... server-side validation is always required.


Installation

First, get the package

Install with bower: bower install multifile or download zip from GitHub multifile.zip

Then, invoke the required javascript files to your document, just before the </html> tag.

Add jQuery to your page. We strongly recommend you make use of Google's Hosted Libraries service.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

Then add the plugin (after jQuery)

<script src="/path/to/plugin/jquery.MultiFile.min.js"></script>

Note that, before v2.2.2, the file was called jQuery.MultiFile.min.js instead (jQuery recommended to use a lowercase โ€˜qโ€™ in package names).


Recommended Usage (HTML5)

Just add multiple="multiple" and class="multi" attributes to your <input type="file"/>, like this:

<input type="file" multiple="multiple" class="multi"/>

Use the maxlength property if you want to limit the number of files selected. Server-side validation is always required

<input type="file" multiple="multiple" class="multi" maxlength="2"/>

Use the accept if you only want files of a certain extension to be selected Separate valid extensions with a "|", like this: "jpg|gif|png". Server-side validation is always required.

<input type="file" multiple="multiple" class="multi" accept="gif|jpg"/>

Legacy Usage (pre HTML5)

Versions of HTML and xHTML prior to HTML 5 do not support the multiple="multiple" attribute. The plugin will still work in almost the same way, but your users will only be able to one file at a time.

<input type="file" class="multi"/>

Use the maxlength property if you want to limit the number of files selected. Server-side validation is always required

<input type="file" class="multi" maxlength="2"/>

Use the accept if you only want files of a certain extension to be selected Separate valid extensions with a "|", like this: "jpg|gif|png". Server-side validation is always required.

<input type="file" class="multi" accept="gif|jpg"/>

Full Documentation and Demos

For more examples, documentation and a full list of features available, please visit the plugin's official website.


Continous Integration with Travis CI

Master Status: full build history on Travis CI

multifile's People

Contributors

fyneworks avatar mirabilos avatar lianee avatar micteu avatar reestyle-it avatar bryant1410 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.