bootstrap上传插件fileinput

bootstrap上传插件fileinput功能很是强大,本文给出一例自动上传&上传成功回调的用例.核心就是调用 filebatchselected 文件选择完成事件实现的,文件上传成功的事件是 fileuploaded .
<script>
    $("#update_csv").fileinput({
        showUpload: false,
        language:'zh',
        uploadAsync:true,
        dropZoneEnabled:false,
        uploadUrl:'http://www.soyiyuan.com/',
        maxFileCount: 1,
        maxImageWidth: 600,
        resizeImage: false,
        showCaption: false,
        showPreview: false,
        browseClass: "btn btn-primary btn-lg",
        allowedFileExtensions : ['csv', 'txt'],
        previewFileIcon: ""
    }).on("filebatchselected", function(event, files) {
            $(this).fileinput("upload");
        })
        .on("fileuploaded", function(event, data) {
        if(data.response)
        {
            alert('处理成功');
        }
    });
</script>