0

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

$('.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

4

0 回答 0