脚本
<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>
html
@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>
}
consol 日志输出与我预期的一样正确。
localhost:4574/Content/uploadify/uploadify.swf
错误信息:
GET localhost:4574/Admin/uploadify.swf?preventswfcaching=1360522154772 404(未找到)
注意:脚本和 html 代码位于名为“Admin”的区域中。
我找不到我想念的东西。有什么建议吗?
谢谢...