AjaxUpload显示文件上传进度

时间:2014-02-03 05:29:16

标签: jquery

<script>
new AjaxUpload(btnUpload1, {
    action: 'http://example.com/addfile.php',
    name: 'uploadfile',
    fid: 'uploadfile1',
    dataType:'json',
    onSubmit: function(file, ext){

    },
    onComplete: function(file, response){
        alert("File Uploaded");
    }
});
</script>

我想在文件上传时显示进度条。

有人可以建议我这个如何显示这个AjaxUpload的进度条吗?

提前致谢。

1 个答案:

答案 0 :(得分:0)

function sample(){
$('.progressbar').show();
new AjaxUpload(btnUpload1, {
    action: 'http://example.com/addfile.php',
    name: 'uploadfile',
    fid: 'uploadfile1',
    dataType:'json',
    onSubmit: function(file, ext){

    },
    onComplete: function(file, response){
        alert("File Uploaded");
        $('.progressbar').hide();
    }
});
}