0
可能重复:
Uploadify: show error message from HTTP responseuploadify错误HTTP:undefined?
我试图让Uploadify在我的asp.net MVC 3应用工作。我收到一个错误(请参阅标题)。这是我的看法:
@{
ViewBag.Title = "Home Page";
}
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery-1.3.2.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/swfobject.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.uploadify.v2.1.0.min.js")"></script>
<input type="file" name="fileInput1" id="fileInput1" />
<span id="result"></span><a href="javascript:$('#fileInput1').uploadifyUpload();">Upload
File</a>
<script type="text/javascript">
$(document).ready(function() {
$("#fileInput1").uploadify({
uploader: '@Url.Content("~/Scripts/uploadify.swf")',
script: '@Url.Action("Upload", "Upload")',
fileDataName: 'file',
buttonText: 'File Input 1...',
multi: false,
sizeLimit: 22222222222,
simUploadLimit: 1,
cancelImg: '@Url.Content("~/Scripts/cancel.png")',
auto: false,
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") {
console.log("error " + d.type + ": " + d.status);
alert("error " + d.type + ": " + d.status);
}
else if (d.type === "File Size")
$("#result").html("file too big");
//alert(c.name + " " + d.type + " Limit: " + Math.round(d.info/(1024 * 1024)) + "MB");
else
alert("error " + d.type + ": " + d.text);
},
onComplete: function (event, queueId, fileObj, response, data) {
alert(response);
}
});
});
</script>
谈谈你的控制器动作?它打了吗? –
控制器操作未命中 – user603007