jQuery Ajax File Upload

>> Saturday, December 10, 2011

I needed a simple and easy to configure and use script, for uploading a single file using Ajax and jQuery, yet the solutions were overcomplicated... So I decided to make my own plugin, it works on FF, Chrome and IE, as far as I tested, it's pretty small (2kb minified) and easy to use, it can only upload one file though, maybe in the future versions I'll just make a plugin to send a multipart form as Ajax.
Anyways! You can get the plugin here, to use it just include the js file and configure it!

<script src="ajax_upload.min.js"></script>
        'script': 'myScript.php',
        'button': $('#chooseFile'),
        'status-id': 'a-status',
        'iframe-id': 'a-iframe',
        'container': $('#uploaderContainer'), // optional
        'onComplete': function(data){ /* my function */ }

And that's it! I hope you find it useful as I did :) That will just send a file named 'file_upload' to the script, just handle as usual.

Post a Comment

  © Blogger template Simple n' Sweet by Ourblogtemplates.com 2009

Back to TOP