js swfupload添加上传进度条实现代码

  function uploadProgress(file, bytesLoaded) {

  try {

  var percent = Math.ceil((bytesLoaded / file.size) * 100);

  var progress = new FileProgress(file, this.customSettings.upload_target);

  progress.setProgress(percent);

  if (percent === 100) {

  progress.setStatus("上传完毕,正在释放内存,请锁定鼠标,不要乱动,正在保存......");

  progress.toggleCancel(false, this);            

  //跳转到上传成功网页

  refresh();

  }

  //显示上传信息

  else {

  progress.setStatus("上传中,请梢后......‖已上传:"+(bytesLoaded/(1024*1024))+"/"+file.size+" 『"+percent+"%』");

  progress.toggleCancel(true, this);

  }

  } catch (ex) {

  this.debug(ex);

  }

  }

文章来源:互联网



微信扫描下方的二维码阅读本文

  • js swfupload添加上传进度条实现代码已关闭评论
  • 9 views
    A+
发布日期:2016年03月30日  所属分类:JAVA