HTTP ERROR (404) with uploadify and custom uploader for asp net [ASP NET MVC 4]

隐身守侯 提交于 2019-12-24 20:18:47

问题


I need to implement uploadify on my asp net mvc 4 application.

I have replaced the uploadify.php with this simple class just for test purpose:

public class uploadify : IHttpHandler
{
    public void ProcessRequest(HttpContext context)
    {
        HttpPostedFile oFile = context.Request.Files["Filedata"];

        oFile.SaveAs("C:\\" + oFile.FileName);
    }

    public bool IsReusable
    {
        get { return false; }
    }
}

And the config is like that:

$('#file_upload').uploadify({
    'swf': '../../Components/uploadify/uploadify.swf',
    'uploader': '../../Scripts/uploadify/uploadify.cs',
    'auto': false,
    'buttonText': 'Selecionar',
    'debug': true
});

I am getting a HTTP ERROR (404) The path for the uploadify.cs is correct so I don´t see why this resource is not found.


回答1:


If you are doing the site in MVC 4, why not just use a controller instead of an IHttpHandler?

Example of 'How do I get jQuery's Uploadify plugin to work with ASP.NET MVC?'



来源:https://stackoverflow.com/questions/14609590/http-error-404-with-uploadify-and-custom-uploader-for-asp-net-asp-net-mvc-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!