美文网首页
webupload的分段上传

webupload的分段上传

作者: yesia | 来源:发表于2019-06-11 14:26 被阅读0次

    一:视频的暂停,开始
    注意stop中的true!!我就是刚开始没传,结果暂停没作用!!

     $upload.on('click', function() {
    
                if ( $(this).hasClass( 'disabled' ) ) {
                    return false;
                }
    
                if ( state === 'ready' ) {
                    uploader.upload();
                } else if ( state === 'paused' ) {
                    uploader.upload();
                } else if ( state === 'uploading' ) {
                    uploader.stop(true);
                }
            });
    

    二:上传成功后,如何获取后台返回的参数(uploadSuccess):

     uploader.on( 'uploadSuccess', function( file ,response) {
              
                    if(response.status==1)
                    {
                        window.parent.document.getElementById('video_path').value=response.path
                       
                        $(".state-finish").text('上传成功')
    
                    }else{
                        alert('上传失败!!')
                    }
                });
    

    相关文章

      网友评论

          本文标题:webupload的分段上传

          本文链接:https://www.haomeiwen.com/subject/qfhqfctx.html