ASP.NET MVC 4 批量上传文件
上传文件的经典写法:
<form id="uploadform" action="/Home/UploadFile" method="post" enctype="multipart/form-data">
<input type="file" name="uploadfile" />
<input type="submit" value="上传" />
</form>
这里的表单form里只有1个file,所以也就只能一次上传一个文件。如果需要上传的文件很多,希望在打开浏览文件窗口后可以用鼠标框选或按着键盘的ctrl键用鼠标去点选,该怎么办呢?
第一种方法——有几个file就在form里写几个file:
<input type="file" name="uploadfile" />
<input type="file" name="uploadfile" />
<input type="file" name="uploadfile" />
<input type="file" name="uploadfile" />
<input type="file" name="uploadfile" />
......
Oh my god !
如果有20个文件要上传的话就写20个<input type="file" name="uploadfile" />?不可以!
第二种方法——用jquery克隆文件
这样form里还是只写一个file,然后用jquey去动态添加。效果如图:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAioAAABrCAIAAADWyT4EAAAgAElEQVR4nO3dZ1RU18I/fp617lrPffEk95frTfJPoibGnmhsYcbIgGhsFCsKGJqIBZEuHRQpKooVkSJVQHqXXhSQ3mfobRjKzMD0zjBt/18cM44D4pibRBP3Z82LM+fsOWc7uPhy9tlFDUAQBEHQn07tXVcAgiAI+hDB+IEgCILeARg/EARB0DsA4weCIAh6B2D8QBAEQe8AjB8IgiDoHYDxA0EQBL0DMH4gCIKgdwDGDwRBEPQOwPiBIAiC3gEYPxAEQdA78Nr4GRkZuXbt2gKfTEhIyMvLU9pZWloaHx//uo9ERETU19e/bRWVPHr0qLi4+I3F2tvbr1+/ruI5CQTCwv/YjIyMrKwsFc/2J0hISCgqKpq7X8UvR0USicTPz4/JZL6x5P3792traxcuMzQ0dOPGDcU9V69enZyc/K+qCEHQX9Yr8XP9+vXc3Fxku66ubsOGDfJDHh4eDQ0NioW7u7vNzMxKS0sVd167du3EiRPyt1IFAAAdHZ2wsDDpHDKZTPUaHz9+3NfX943FqFSql5dXcHCwKudsamr64YcfFihgb2/v5OQEAJBKpWZmZjvn6O3tVa36L4hEIiMjo7nn2blzp5GRkVAoVCzs4uLS1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LCwMDAx0cXHh8Xhzz4ygUCgwfiAIgj4oyvFDpVJJ85mamqqvr6+srKyoqKiurq6vr6+oqKj8VXV19eTkJHJ/09vb29/fPzU1RSKRyGQyn88fGxtrbm6enp6e98zIyWH8QBAEfVBUjR8ikUij0RaYt01ejEqlUigUIpEo34MMSpXvgfEDQRAEKT/7YTKZ0386Go1WUVGB9NuGIAiCPgSvTLqTl5fX0tLS+KdramrKysqC8QNBEPTheBk/dDq9o6Ojs7MT+6fr7Ozs6uqCq6ZDEAR9ONTeXASCIAiCfm8wfiAIgqB3AMYPBEEQ9A7A+IEgCILeARg/EARB0DsA4weCIAh6B2D8QBAEQe8AjB8IgiDoHYDxA0EQBL0DMH4gCIKgdwDGDwRBEPQO/P8IFkr24mtpdgAAAABJRU5ErkJggg==" alt="" />
<form id="uploadform" action="/Home/UploadFile" method="post" enctype="multipart/form-data">
当前有<span id="inputNum">1</span>个文本框,已选择<label id="fileNum">0</label>个文件。
<div id="upload">
<input type="file" name="uploadfile" style="border: 1px solid gray; width: 500px;" />
</div>
<input type="submit" value="上传" />
</form>
<div id="status"></div>
我们想在文本框后面加一个“添加”、“删除“的链接,点击后增加一个文件框或删除。
既然这个input file是动态添加的,那么后面跟着的“取消”、”增加”也是跟着一起创建的。本以为很难,结果用jquery反而很简单的:
$("input[type=file]").after(
//" <a href='#' class='clear-inputfile'>清除内容</a>" + " | " +
" <a href='#' class='removeInputFile'>取消</a> " + " | " +
" <a href='#' class='addInputFile'>增加</a>"
);
先用input[type=file]找到这个inputy,然后在他的后面(after)加上超链接(a),就这么简单!
Jquery:
//增加多个文本框 (复制当前行)
$('.addInputFile').click(function () {
var clone = $(this).parent().clone(true);//true:连事件一起复制
var file = clone.children("input[type=file]").val(null);
$(clone).insertAfter($(this).parent());
});
clone() 方法
定义和用法
clone() 方法生成被选元素的副本,包含子节点、文本和属性。
语法
$(selector).clone(includeEvents)
这里把事件一起复制了,所以是:
var clone = $(this).parent().clone(true);
注意我们复制的是<div id="upload">。
如果已经选择了文件,克隆后会把文件框里的内容一起复制过来,所以在val()中加上null清除内容:
var file = clone.children("input[type=file]").val(null);
增加后也要有取消,当取消到只剩一个的时候给个提示。
//删除
$('.removeInputFile').click(function () {
var num = $('#upload input[type=file]').length;
if (num == 1) {
alert('必须保留一个!');
return false;
}
$(this.parentElement).remove();
});
动态添加文件操作完毕!
上传文件后如果刷新浏览器会再次提交,这个问题很普遍,一不注意就重复提交了。所以这里采用ajax的方式上传文件!用mvc的Ajax.BeginForm吗?这个就是异步的啊!但是如果不配合一个插件来的话,单靠Ajax.BeginForm还是不能完成异步上传文件并且避免刷新重复提交!!这个插件就是jquery.form.js。
$('form').ajaxForm({
dataType: "html",//json也可以,以避免FF里此错误:HierarchyRequestError: Node cannot be inserted at the specified point in the hierarchy
///判断是否有文件 formData不支持IE!
///formData is an array of objects
///representing the name and value of each field that will be sent to the server;
beforeSubmit: function (formData) {
//没有选择文件则退出
if (selectedFileNum() == 0) {
alert("请选择文件!");
return false;
}
},
success: function (responseText) {//responseText:后台传来的string
status.html(responseText);
},
error: function (xhr, textStatus, errorThrown) {//在前端挡住请求
alert('文档上传错误.' + xhr.responseText);//例如文件过大等错误
status.html(xhr.responseText);
},
complete: function (xhr) {
status.html(xhr.responseText);
$("form").resetForm();//重置表单
}
});//end jquey.form
Ajax.BeginForm也要配合jquery.form.plugin一起使用
Ajax.BeginForm的写法:
@using (Ajax.BeginForm(
"UploadFile",
"Home",
new AjaxOptions
{
UpdateTargetId = "status",
HttpMethod = "Post"
},
new { enctype = "multipart/form-data" }
)
)
{
<div id="upload">
<input type="file" name="uploadfile" style="border: 1px solid gray;" />
</div>
<input type="submit" value="上传" />
}
目前都是前端的操作,接下来看后台的保存文件到服务器是怎么做的。
Controller:
//上传文件
[HttpGet]
public ActionResult UploadFile() { return View(); }
[HttpPost]
public ActionResult UploadFile(IEnumerable<HttpPostedFileBase> uploadfile)
{
foreach (var file in uploadfile)
{
if (file != null && file.ContentLength > )
{
var fileName = Path.GetFileName(file.FileName);
var path = Path.Combine(Server.MapPath("~/Uploads"), fileName);
//如遇相同文件则先删除再保存
if (System.IO.File.Exists(path))
System.IO.File.Delete(path);
file.SaveAs(path);
}
}
return Content("上传完毕!");
}
因为上传的是多个文件,所以这里要用IEnumerable<HttpPostedFileBase>类型。使用HttpPostedFileBase来接收传递的文件是ASP.NET MVC的推荐做法,不推荐用Request。要注意HttpPostedFileBase类型的参数uploadfile,这个名称要和前端form里的input的name保持一致!
第三种方法——使用jquery上传插件
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZUAAADyCAIAAAAKv886AAATQ0lEQVR4nO3df4gUZ57H8YJZHGRkk5Folk1O7+IfciYQ0wmeJMuBt7fnH4p0ECIb4jYkx2b947zDC8ci3Amb7DVxmZMZZ6H3QHHOXSbHen3e5gY3y6LBA5dEovS50XWNpytR/IE/UKcbm4Hn/qjp6qee56ma6u7qH9+e94svYab6qaqn2qmPz/N0jfEUAMjkdbsDANAk8guAVOQXAKnILwBSkV8ApOpEfk29/6YX9rXn37zegRNbzh8eie7AzC8L3186tGDB0NLvF345E3ucG7//9J03NiwdXhRc0YtbR9rWawBu5Ffg4p8PLfBfXbzitS+jD3K19OGywQHjisgvoPPs/Dr/Yu2WPB9+YWTr7Csjh89be8URkl8Jx19fblmx2LOQX0DndSK/Atd/O/W13s2vRG797qOnPM/zvIHBZQd+ffpRyh0E0ADyq8kjvPDt3fFrZADarfn8CsJoR+H41bPHt/7lmkWDA5438PTKb3zw8RnnvZ0gvx6d+PDAhrWrFg0OeJ63YOjx59ZuOGQd7eblM3v+8e3nln99dr3KW/D15c+98/6/3aiap7375Zld333tj5c87o+Zhoe/audXcF1JJoNBfrnaBFPLhYVfXQi/NFPYts7fcfv40aiDA2hICvm1et03nzTXs4dGDp+2TxafXzPVGz/Y8oq5MO55njewafu/PnD00LTspb++qkXY6cN7hq2F9ubyy25jHG/qt9eVUkfHt/vfr9tW0KN0pnph3fBCz/MGBlefulOO+fMAkFwK+eU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GQau788rykGWe0TLhjkmZ2m+S9AtCvup9fSVrG55dzdwIO6HtdyC8vsZhD+VuMZs11G4BQqeVX0Cw+iZo4oH1MFZtcDZ0FgFzp51f8js0drYn1L/IL6Hvp5FcTg6wk08aYo7UecACkS5pN8RFjTOuSB1PSXoYnp4r8ApDK+CthoLTCmYBzRmqKHQDQg1rNL31klHyXJGL6kCSbyC+g73Xh88eogydPHPILgGrr54+NvuRslnCwFp+SAPpSW/KroblkoydqqCWAPtau8ZfnWtRPskuSkzJ/BKA6//xqTAPyC0BD3E9yNbHeFLV6FXnixn8lO+GrAOaJ1IIgeX7FrLUnXIwnvwCoFPMLADqM/AIgFfkFQCryC4BU5BcAqcgvAFKRXwCkIr8ASPX/D4jRwmP9KDgAAAAASUVORK5CYII=" alt="" />
上面说那么多,其实这个才是主角。
要想一次性在浏览窗口中选中多个文件同时上传到服务器,还是要用个插件才方便。寻觅很久还是发现uploadify最合心意,其他的也很优秀,但是在IE浏览器里无法一次多选,只能是点一次选一个点一次选一个,然后一起上传。
uploadify常用的一些设置:
$(document).ready(function () {
$("#myUploadFile").uploadify({
//属性
'auto': true, //自动上传
'height': 30, //按钮的高度
'width': 80, //按钮的宽度
'swf': '../Scripts/Uploadify/uploadify.swf', //必输入!flash.注意路径!!
'fileObjName': 'uploadfile', //传递给后台程序的参数, 否则会接收不到!
'uploader': '../Home/Uploadify', //后台处理程序. 注意路径!!
'queueID': 'queue', //显示上传队列的容器
'buttonText': '选择文件', //按钮显示文字
//'fileSizeLimit': '5MB',
//'queueSizeLimit': 5, //同时允许上传5个文件
'fileTypeExts': '*.xls;*.xlsx',
'removeCompleted': false, //上传后保持队列不消失
'requeueErrors': true,
//事件
'onSelect': function (file)//从浏览窗口中选择文件
{
if (file.size / 1024 / 1024 > 10) //文件10M
{
alert('文件过大,请分批上传!');
$('#myUploadFile').uploadify('cancel', file.id); //cancel方法可以带上file的id作为参数,指定取消该项。
}
},
'onCancel': function (file)//从队列中取消文件
{
//alert('文件: ' + file.name + ' 被取消.');
//document.getElementById("fileCount").value -= 1;
},
'onClearQueue': function (queueItemCount) {//只在未上传前有效,上传后其实还保存在队列中。
//alert(queueItemCount + ' file(s) were removed from the queue');
},
'onDialogClose': function (queueData) //当浏览窗口关闭时
{
//alert(queueData.filesQueued + ' files were queued of ' + queueData.filesSelected + ' selected files. There are ' + queueData.queueLength + ' total files in the queue.');
//document.getElementById("fileCount").value = queueData.queueLength; //队列中文件数量
//document.getElementById("lblStatus").innerText = "";
},
'onQueueComplete': function (queueData)//全部上传完毕后触发
{
//alert(queueData.uploadsSuccessful + ' 个文件成功上传。上传后请点击“提交”。');
//document.getElementById("fileCount").value = "";
//window.location.href = "Default.aspx"//重加载页面
// window.location.reload(); //
//alert("reload");
//alert("upload Done");
},
'onUploadError': function (file, errorCode, errorMsg, errorString) {
alert('The file ' + file.name + ' 上传失败: ' + errorString);
//alert('errorCode:'+errorCode);
//alert('errormsg:' + errorMsg);//500
//alert('errorString:' + errorString);//HTTP Error (500)
},
'onUploadSuccess': function (file, data, response) {
//alert('The file ' + file.name + ' 上传成功!');
//alert('data is :' + data);//data是controller传来的str
$('#msg').text(data);
//alert('response is :' + response); //response is true
},
'onSelectError': function (file, errorCode, errorMsg) //错误信息
{
switch (errorCode) {
case -100:
alert("上传的文件数量已超过系统限制的" + $('#myUploadFile').uploadify('settings', 'queueSizeLimit') + "个文件");
break;
case -110:
alert("文件(" + file.name + ")大小超出系统限制的" + $('#myUploadFile').uploadify('settings', 'fileSizeLimit') + "大小!");
break;
case -120:
alert("文件(" + file.name + ")大小异常!");
break;
case -130:
alert("文件(" + file.name + ")类型不正确!");
break;
}
}
});
}); <input type="file" id="myUploadFile" />
<p id="queue"></p>
Controller:
[HttpGet]
public ActionResult Uploadify() { return View(); }
[HttpPost]
public ActionResult Uploadify(HttpPostedFileBase uploadfile)
{
if (uploadfile != null && uploadfile.ContentLength > )
{
var fileName = Path.GetFileName(uploadfile.FileName);
var path = Path.Combine(Server.MapPath("~/Uploads"), fileName);
if (System.IO.File.Exists(path))
System.IO.File.Delete(path);
uploadfile.SaveAs(path);
}
return Content("上传完毕!");
}
这样就满足了同时上传文件的需要——在IE里。
--End--
ASP.NET MVC 4 批量上传文件的更多相关文章
- ASP.NET MVC 4 Ajax上传文件
这两天一直纠结着表单的问题.想在一个表单里实现三个功能: 输入查询条件,点击查询: 导出查询数据: 上传文件: 方法有很多,乱花渐欲迷人眼,尝试了很多,无果.大致说的是,给不同按钮写js代码,在js代 ...
- asp.net Mvc 使用uploadify 上传文件 HTTP 302 Error
CSHTML代码 @{ if (Request.Cookies[FormsAuthentication.FormsCookieName] != null) { <input type=" ...
- ASP.NET MVC+LayUI视频上传
前言: 前段时间在使用APS.NET MVC+LayUI做视频上传功能的时,发现当上传一些内存比较大的视频就会提示上传失败,后来通过查阅相关资料发现.NET MVC框架为考虑安全问题,在运行时对请求的 ...
- Linux命令之rz - 批量上传文件,简单易用(转载)
用途说明 rz命令能够批量上传文件,当然也可上传单个文件啦.使用的协议是古老的ZMODEM协议,尽管协议古老,但毫不影响的简单易用的特性.一般情 况我们要上传文件到Linux系统,要么使用ftp(还得 ...
- 转 Android网络编程之使用HttpClient批量上传文件 MultipartEntityBuilder
请尊重他人的劳动成果,转载请注明出处:Android网络编程之使用HttpClient批量上传文件 http://www.tuicool.com/articles/Y7reYb 我曾在<Andr ...
- 不带插件 ,自己写js,实现批量上传文件及进度显示
今天接受项目中要完成文件批量上传文件而且还要显示上传进度,一开始觉得这个应该不是很麻烦,当我在做的时候遇到了很多问题,很头疼啊. 不过看了别人写的代码,自己也测试过,发现网上好多都存在一些问题,并不是 ...
- Python基于Python实现批量上传文件或目录到不同的Linux服务器
基于Python实现批量上传文件或目录到不同的Linux服务器 by:授客 QQ:1033553122 实现功能 1 测试环境 1 使用方法 1 1. 编辑配置文件conf/rootpath_fo ...
- input file multiple 批量上传文件
这几天维护系统,有一个批量上传文件功能,出现了一点小问题 我的笔记本选择要上传的文件很正常 但在测试环境上,别人的电脑上,选择上传文件之后 一开始,以为是代码问题,网上找了很多的资料,但还是没用,然后 ...
- 使用 sendKeys(keysToSend) 批量上传文件
未经允许,禁止转载!!! 在selenium里面处理文件上传的时候可以使用sendKeys(keysToSend) 上传文件 例如: element.sendKeys(“C:\\test\\uploa ...
随机推荐
- NotePad++ delphi/Pascal函数过程列表插件
从cnpack上爬下来的 函数过程列表 点击下载
- xmpp 协议之可扩展消息(messaging)与状态(presence)协议核心: RFC 3920
附:asmack已经不需要了,4.1以后的smack已经可以在android上使用了. XMPP Clients: http://xmpp.org/software/clients.html An ...
- mysql数据库中查询时间
项目中要对数据按时间处理,在数据库中,时间处理的格式如 2014-12-09 06:30:17 时间查询出来如下所示: 现在要查询具体有哪天的数据,应用substring函数,SQL如下: ) as ...
- 使用truss、strace或ltrace诊断软件的“疑难杂症”
简介 进程无法启动,软件运行速度突然变慢,程序的"Segment Fault"等等都是让每个Unix系统用户头痛的问题,本文通过三个实际案例演示如何使用truss.strace和l ...
- javascript中document对象的属性和方法
document.documentElement; document.firstChild;document.childNodes[0];// 取得对<html>的引用document.b ...
- Web安全--使用Salt + Hash将密码加密后再存储进数据库
转载原地址 http://www.bozhiyue.com/mianshiti/_net/2016/0728/314239.html (一) 为什么要用哈希函数来加密密码 如果你需要保存密码(比如网站 ...
- Serializable 序列化为字符串 base64
工具类 Base64.java import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import ja ...
- Java NIO类库Selector机制解析(下)
五. 迷惑不解 : 为什么要自己消耗资源? 令人不解的是为什么我们的Java的New I/O要设计成这个样子?如果说老的I/O不能多路复用,如下图所示,要开N多的线程去挨个侦听每一个Channel ...
- SQLite的37个核心函数
转载:http://www.feiesoft.com/00012/ abs(X) abs(X)返回 X 的绝对值. Abs(X) returns NULL if X is NULL. Abs(X) r ...
- HttpContext讲解
http://www.cnblogs.com/scy251147/p/3549503.html http://www.360doc.com/content/14/0526/10/17655805_38 ...