View on GitHub

Upload Monkey

A jQuery plugin that handles file uploads

Download this project as a .zip file Download this project as a tar.gz file

Upload Monkey

A simple file upload plugin that permforms POST and PUT XHR Level 2 uploading. The plugin will fallback to the old iFrame hack if the browser doesn't support XHR (e.g. IE). If the upload method is set to POST all files will be uploaded as one single request. If the upload method is set to PUT each file will be uploaded separately.


Download


Usage

Given a simple html file.

<html>
<head>
    <title></title>
</head>
<body>
    <div id="dropzone" class="uploadable"></div>

    <input type="file" name='file' id="files" name="files[]" />

    <div id="preview"></div>

    <div id="queue"></div>
</body>
</html>

You can attach the Upload Monkey plugin multiple ways, but in it's simpiest form just bind it to a file input or drag and drop dropzone.

var upload = $('input#files').UploadMonkey(options);

or

var upload = $('div#dropzone').UploadMonkey(options);

You can also specify a drag and drop dropzone while it is bound to a file input.

var upload = $('input#files').UploadMonkey({
        dragDrop        : true,
        dropZone        : $('div#dropzone'),
        dropZoneText    : 'Drop files here...',
        action          : 'http://www.upload.me.com/upload.php',
        }
    });

You can also do the reverse, bind it to a drag and drop dropzone and specify a file input.

var upload = $('div#dropzone').UploadMonkey({
        fileInput       : $('input#files'),
        dragDrop        : true,
        dropZoneText    : 'Drop files here...',
        action          : 'http://www.upload.me.com/upload.php',
        }
    });

Options

Upload Monkey was designed to be as flexible as possible but still completely functional.

Debugging

Queue

File

Sending

Preview Image

File Input

Drag and Drop

Events

Methods


MIT License


Copyright (c) 2012 Steve Ricciardelli

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.