swfupload添加上传进度条(转)
- //将progress.setStatus("Uploading..."); 替换成 progress.setStatus("正在上传("+percent+" %)请稍后...");即可
- 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);
- } else {
- progress.setStatus("正在上传("+percent+" %)请稍后...");
- progress.toggleCancel(true, this);
- }
- } catch (ex) {
- this.debug(ex);
- }
- }