uploadify onSelect

uploadify onSelect 【return false】停止选择

$("#fileEleId").uploadify({
            'width': _option.width,
            'height': _option.height,
            'swf': '/js/plugin/uploadify/uploadify.swf',
            'uploader': _option.url,
            'queueID': _option.fileListId,
            'buttonClass': _option.buttonClass,
            'buttonText': _option.buttonText,
            'multi': true,
            'fileObjName': _option.fileObjName,
            'fileSizeLimit': _option.fileSizeLimit,
            'formData': _option.formData,
            'itemTemplate': '<li id="\${fileID}" class="attch-item"></li>',
            'onSelect': function(file){
                if(file.name.length > 200){
                    this.cancelUpload(file.id);
                    this.queueData.filesCancelled++;
                    this.queueData.queueSize -= file.size;
                    delete this.queueData.files[file.id];
                    alert("亲,您上传的文件名过长!",);
                    return false;
                }
            }
        });

 

posted @ 2017-02-03 15:17  N神3  阅读(744)  评论(0编辑  收藏  举报