Asp.net mvc Asp.NETMVC上传?
剧本Asp.net mvc Asp.NETMVC上传?,asp.net-mvc,uploadify,Asp.net Mvc,Uploadify,剧本 $(文档).ready(函数(){ log('@Url.Content(Request.Url.Authority+“/Content/uploadify/uploadify.swf”); $(函数(){ $(“#文件”).uploadify({ “uploader”:“@Url.Content(Request.Url.Authority+”/Content/uploadify/uploadify.swf”), 'script':'@Url.Action('u UploadImage',
$(文档).ready(函数(){
log('@Url.Content(Request.Url.Authority+“/Content/uploadify/uploadify.swf”);
$(函数(){
$(“#文件”).uploadify({
“uploader”:“@Url.Content(Request.Url.Authority+”/Content/uploadify/uploadify.swf”),
'script':'@Url.Action('u UploadImage','Authors',new{area=“Admin”}),
“cancelImg”:“@Url.Content(Request.Url.Authority+”/Content/uploadify/uploadify cancel.png”),
“自动”:false,
“多重”:错误
});
})
});
Html
@使用(Html.BeginForm(“Upload”、“Home”、FormMethod.Post、new{enctype=“multipart/formdata”、id=“form_image”}))
{
}
控制台日志输出与我的预期相符
localhost:4574/Content/uploadify/uploadify.swf
错误消息:
得到
localhost:4574/Admin/uploadify.swf?preventswfcaching=1360522154772
404(未找到)
注意:脚本和html代码位于名为“Admin”的区域中
我找不到我错过了什么。有什么建议吗
谢谢…当没有背景图像上传时,BUG会对当前页面url发出错误的http请求,并在最后附加false 这个bug的解决方案是“jquery.uplodify.js”。 找到这条线
this.settings.upload\u url=WFUpload.completeURL(this.settings.upload\u url);this.settings.button\u image\u url=SWFUpload.completeURL(this.settings.button\u image\u url)
this.settings.upload\u url=SWFUpload.completeURL(this.settings.upload\u url);this.settings.button\u image\u url=this.settings.button\u image\u url?SWFUpload.completeURL(this.settings.button\u image\u url):this.settings.button\u image\u url
<script>
$(document).ready(function () {
console.log('@Url.Content(Request.Url.Authority + "/Content/uploadify/uploadify.swf")');
$(function () {
$("#file").uploadify({
'uploader': '@Url.Content(Request.Url.Authority + "/Content/uploadify/uploadify.swf")',
'script': '@Url.Action("_UploadImage", "Authors", new { area = "Admin" })',
'cancelImg': '@Url.Content(Request.Url.Authority + "/Content/uploadify/uploadify-cancel.png")',
'auto': false,
'multi': false
});
})
});
</script>
@using (Html.BeginForm("Upload", "Home", FormMethod.Post, new { enctype = "multipart/form-data", id = "form_image" }))
{
<p>
<input type="file" name="file" id="file" />
<a href="javascript:$('#file').uploadifyUpload();">Resmi Yükle</a>
</p>
}