A JQuery plugin for uploading files using ajax
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
file-upload.js

README.md

JQuery ajax upload plugin

Usage example:

HTML

    <div class="input-group">
        <label class="input-group-addon">Image</label>
        <input class="form-control" type="file" name="image" id="image"/>
    </div>

JS

    $(document).ready(function(){
       $("#image").fileUpload({
            url:        "/upload.php",
            onSuccess:  function(response){
                        //your code here
                    },
            onError:    function(response){
                        //your code here
                    },
            before:     function() {
                        //your code here
                    },
            after:      function() {
                        //your code here
                    },
            responseType: "json",
            container:  $(this).parent(),
            uploadOn: {
                    selector: "#image",
                    clientEvent: "change"
            }
       });
    });

The reason why I made this was just because I wanted to define on what element and event would the image be uploaded