求大神帮忙!如何在MVC的开发模式下实现文件的批量上传及下载?

求大神帮忙!如何在MVC的开发模式下实现文件的批量上传及下载?

html代码 form表单中 加N个file类型的input
<input name="file1" type="file" />
<input name="file2" type="file" />
<input name="file3" type="file" />

public ActionResult Save()
{
    if(Request.Files.Count > 0)
    {
        string yourfilepath = "这里是你的存放路径";
        if(Request.Files["file1"].ContentLength > 0)
        {
            Request.Files["file1"].Save(yourfilepath);
        }
        if(Request.Files["file2"].ContentLength > 0)
        {
            Request.Files["file2"].Save(yourfilepath);
        }
        if(Request.Files["file3"].ContentLength > 0)
        {
            Request.Files["file3"].Save(yourfilepath);
        }
    }
    return View();
}

纯手工敲,记得你的悬赏哦。

温馨提示:内容为网友见解,仅供参考
第1个回答  2013-10-17
推荐uploadify,支持上传进度显示追问

有源代码吗

追答

http://www.uploadify.com 有Dome,很多项目都在用

相似回答