fex-team / webuploader

It's a new file uploader solution!
http://fex.baidu.com/webuploader/
BSD 3-Clause "New" or "Revised" License
7.7k stars 2.34k forks source link

上传文件,为什么第一次可以上传,第二次选择文件之后,没有反应?? #1514

Open zhuyihao opened 8 years ago

zhuyihao commented 8 years ago
var uploader;

$(document).ready(function() {

    uploader = WebUploader.create({
        swf: '/assets/js/Uploader.swf',
        server: '/test.php',
        pick: '#picker',
        resize: false
    });

    uploader.on( 'fileQueued', function( file ) {
        $("#thelist").append( '<div id="' + file.id + '" class="item">' +
            '<h4 class="info">' + file.name + '</h4>' +
            '<p class="state">等待上传...</p>' +
            '</div>' );
    });

    uploader.on('uploadSuccess', function( file ) {
        $( '#'+file.id ).find('p.state').text('已上传');
    });

    $("#ctlBtn").click(function(){
        uploader.upload();
    });

});
873968102 commented 8 years ago

duplicate {Boolean} [可选] [默认值:undefined]

去重, 根据文件名字、文件大小和最后修改时间来生成hash Key.

VaJoy commented 8 years ago

我也遇到这个问题,太奇怪了,第二次调用uploader.upload() 就失效。 duplicate 已经配了true的,换成false也一样