我正在使用uploadify在服务器上上传多个...
下面是我的 html 标记
<%using (Html.BeginForm("MultiUpload", "Home", FormMethod.Post))
{ %>
<div id="InterestingDiv">
<a href="javascript:$('#fileInput1').uploadifyUpload();" class="uploadLink" title="Click to Upload Files">Upload Files</a>
<input id="fileInput1" name="File" type="file" />
</div>
<%}%>
以及我如何声明脚本...
<link href="<%:Url.Content("~/Content/themes/base/jquery.ui.all.css") %>" rel="stylesheet" type="text/css" />
<link href="<%:Url.Content("~/jquery.uploadify-v2.1.4/uploadify.css") %>" rel="stylesheet" type="text/css" />
<script src="<%:Url.Content("~/jquery.uploadify-v2.1.4/jquery-1.4.2.min.js") %>" type="text/javascript"></script>
<script src="<%:Url.Content("~/jquery.uploadify-v2.1.4/swfobject.js") %>" type="text/javascript"></script>
<script src="<%:Url.Content("~/jquery.uploadify-v2.1.4/jquery.uploadify.v2.1.4.js") %>" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#fileInput1").uploadify({
'uploader': '<%:Url.Content("~/jquery.uploadify-v2.1.4/uploadify.swf")%>',
'script': '<%: Url.Action("MultiUpload") %>',
'auto': false,
'multi': true,
'expressInstall': '<%:Url.Content("~/jquery.uploadify-v2.1.4/expressInstall.swf")%>',
'cancelImg': '<%: Url.Content("~/jquery.uploadify-v2.1.4/cancel.png") %>',
'scriptAccess': 'always',
'buttonText': 'Browse Files...',
'hideButton': false,
'folder': '<%:Url.Content("~/Content/") %>',
'fileDesc': 'Excel Files',
'fileExt': '*.xlsx',
'fileDataName': 'File',
'sizeLimit': 1000000000,
onError: function (a, b, c, d) {
if (d.status == 404)
alert("Could not find upload script. Use a path relative to: " + "<?= getcwd() ?>");
else if (d.type === "HTTP")
alert("error " + d.type + ": " + d.status);
else if (d.type === "File Size")
alert(c.name + " " + d.type + " Limit: " + Math.round(d.sizeLimit / 1024) + "KB");
else
alert("error " + d.type + ": " + d.text);
}
});
});
</script>
下面是我的控制器代码...
public ActionResult MultiUpload(HttpPostedFileBase File)
{
//handle file here
return Json(new { status = true });
}
我的代码在开发环境中成功运行,但是一旦我将它部署在 iis7 上,无论是本地 iis 还是服务器 iis,它都没有达到我的 MultiUpload 操作...
我只是想实现多个文件选择和上传...