【问题标题】:how add uploading progress bar in express如何在快递中添加上传进度条
【发布时间】:2012-09-19 02:56:43
【问题描述】:

我正在使用 jquery_form 上传文件到快递服务器,它可以工作。但是没有进度条。所以请帮忙添加进度条。相信很多人也需要这个。

这里是代码

客户端:

$('#uploadvideoform').ajaxSubmit({
            error:function(xhr){
                alert(xhr);
            },
            success:function(response){
                var videopath = response.path;
                var videoview  = "<video width='320' height='240' controls='controls'>";
                    videoview += "<source src="+videopath+" type='video/mp4' />";
                    videoview += "Your browser does not support the video tag.";
                    videoview += "</video>";
                $('#view_product_video_content').append(videoview);
            },
        })

    return false;

服务器端:

exports.upload = function(req, res){
 var serverPath = 'Temp\\' + req.files.productvideo.name;

 // console.log('req.files.productvideo.path '+req.files.productvideo.path)
 // console.log('F:\\unit2\\'+serverPath);
 require('fs').rename(
  req.files.productvideo.path,
  'F:\\unit2\\'+serverPath,
  function(error){
    if(error){
      console.log(error)
      return;
    }

    res.send({
      path:serverPath,
    });

  });

};

【问题讨论】:

    标签: upload progress-bar express


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 2018-05-28
      • 1970-01-01
      • 1970-01-01
      • 2022-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多