0
我使用uploadify上傳多個服務器上...uploadify不工作的IIS或服務器
下面是我的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行動......
我簡單要實現多個文件選擇並上傳它...
檢查腳本目錄,並確保所有需要的腳本uplodify在那裏,也看螢火蟲的任何錯誤 – dakait
我已檢查,但沒有錯誤...唯一的問題是,MultiUpload的行動方法沒有得到打擊.. – aamankhaan