jquery fileupload插件,如何取消上传文件进程

时间:2013-07-31 08:02:40

标签: javascript jquery

如果某些条件为真,我想取消文件上传的点击事件,例如

$('.fileupload').fileupload({
    url: url,
    dataType: 'json',
    start: function (e, data) {
        //How to acheive this?
        if(some condition 1){
            alert('You can upload file';
            //show the file browser window and upload file as normal
        }
        else{
            alert('You cannot upload file');
            //do not show any file selection window and do not upload any file
        }
    }
});

我正在使用https://github.com/blueimp/jQuery-File-Upload/wiki/Options

0 个答案:

没有答案