Asp.net mvc 在MVC4不工作的情况下上载。IO错误
我正在使用Uploadify3.1版。当我试图上传一个文件时,我发现IO错误 当我将调试器保持在动作方法中时,它不会命中 我尝试了以下链接,但甚至认为是相同的错误 请推荐我 查看Asp.net mvc 在MVC4不工作的情况下上载。IO错误,asp.net-mvc,flash,uploadify,Asp.net Mvc,Flash,Uploadify,我正在使用Uploadify3.1版。当我试图上传一个文件时,我发现IO错误 当我将调试器保持在动作方法中时,它不会命中 我尝试了以下链接,但甚至认为是相同的错误 请推荐我 查看 @{ Layout = null; } <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <link href="@Url.Content("~/uploadify/uploadi
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link href="@Url.Content("~/uploadify/uploadify.css")" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="file_upload"></div>
<script src="@Url.Content("~/Scripts/jquery-1.6.2.js")" type="text/javascript"></script>
@* <script src="@Url.Content("~/uploadify/swfobject.js")" type="text/javascript"></script>*@
<script src="@Url.Content("~/uploadify/jquery.uploadify-3.1.js")" type="text/javascript"></script>
<script type="text/javascript">
$('#file_upload').uploadify({
'uploader': '@Url.Content("~/uploadify/uploadify.swf")',
'flash_url': '@Url.Content("~/uploadify/uploadify.swf")',
'fileObjName': 'fileData',
'script': '@Url.Action("Upload", "Home")',
'cancelImg': '@Url.Content("~/uploadify/cancel.png")',
'folder': '@Url.Content("~/content/images")',
'fileDesc': 'Image Files',
'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
'auto': true
});
</script>
</body>
</html>
试着这样做:
$('#file_upload').uploadify({
'checkExisting': 'Content/uploadify/check-exists.php',
'swf': '@Url.Content("~/uploadify/uploadify.swf")',
'uploader': '@Url.Action("Upload", "Home")',
'auto': false,
'buttonText': 'Browse',
'fileTypeExts': '*.jpg;*.jpeg;*.png;*.gif',
'removeCompleted': false
});
希望这有帮助。您是否检查了上载文件的文件夹的文件夹权限?您需要为IIS用户和网络用户设置该文件夹的权限检查您的控制器,操作必须是AllowAnonymous
$('#file_upload').uploadify({
'checkExisting': 'Content/uploadify/check-exists.php',
'swf': '@Url.Content("~/uploadify/uploadify.swf")',
'uploader': '@Url.Action("Upload", "Home")',
'auto': false,
'buttonText': 'Browse',
'fileTypeExts': '*.jpg;*.jpeg;*.png;*.gif',
'removeCompleted': false
});