jQuery-File-Upload on click and response
===

I'm using the [jQuery-File-Upload plugin][1] but I'm having trouble associating it with a click and generating a response. After I select a file, it automatically uploads to a folder (so at least it's working), but I'd prefer to have it upload upon clicking a button.

Additionally, I need the server to return an ID after the image is uploaded to the database, but I can't seem to get a response.

I've been working on this all day and it's a bit frustrating, but I can't find any other jQuery plugins like this that are updated. If you have an alternative, I'd appreciate it. 

Here's the code:

	<?php echo form_open_multipart('admin/file/upload', array('id' => 'fileupload'));?>

	<input type="file" name="userfile" size="20" multiple />

		<button id="upload_file" type="button" class="btn btn-primary start">
	        <i class="icon-upload icon-white"></i> Start upload
	   </button>

	<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
	<script  type="text/javascript" src="<?=base_url();?>assets/admin/js/fileupload/vendor/jquery.ui.widget.js"></script>
	<script  type="text/javascript" src="<?=base_url();?>assets/admin/js/fileupload/jquery.iframe-transport.js"></script>
	<script  type="text/javascript" src="<?=base_url();?>assets/admin/js/fileupload/jquery.fileupload.js"></script>
	<script  type="text/javascript" src="<?=base_url();?>assets/admin/js/fileupload/jquery.fileupload-ui.js"></script>

	<script>
	$(document).ready(function() {
		$('#fileupload').fileupload({
	    url: $('#fileupload').attr('action'),
	    replaceFileInput: false,
	 	add: function (e, data) {
	 	     data.submit();
	 	 }

		});
	});
	</script>

  [1]: https://github.com/blueimp/jQuery-File-Upload/wiki