Asp.net mvc 剑道UI异步上传帖子始终为空

Asp.net mvc 剑道UI异步上传帖子始终为空,asp.net-mvc,kendo-ui,kendo-upload,Asp.net Mvc,Kendo Ui,Kendo Upload,我需要上传一个文件从我的html页面异步与剑道用户界面上传。几乎所有这些代码都取自这里 HTML $(文档).ready(函数(){ $(“#文件”).kendoUpload({ 异步:{ 保存URL:“http://localhost:57016/DownloadUsingFile/Save", removeUrl:“删除”, 自动上载:true } }); }); 保存在控制器中的操作: public ActionResult Save(IEnumerable<HttpPosted

我需要上传一个文件从我的html页面异步与剑道用户界面上传。几乎所有这些代码都取自这里

HTML


$(文档).ready(函数(){
$(“#文件”).kendoUpload({
异步:{
保存URL:“http://localhost:57016/DownloadUsingFile/Save",
removeUrl:“删除”,
自动上载:true
}
});
});
保存在控制器中的操作:

public ActionResult Save(IEnumerable<HttpPostedFileBase> files)
    {
        // The Name of the Upload component is "files"
        if (files != null)
        {
            foreach (var file in files)
            {
                // Some browsers send file names with full path. This needs to be stripped.
                //var fileName = Path.GetFileName(file.FileName);
                //var physicalPath = Path.Combine(Server.MapPath("~/App_Data"), fileName);

                // The files are not actually saved in this demo
                // file.SaveAs(physicalPath);
            }
        }

        // Return an empty string to signify success
        return Content("");
    }
public ActionResult保存(IEnumerable文件)
{
//上载组件的名称为“文件”
如果(文件!=null)
{
foreach(文件中的var文件)
{
//有些浏览器发送带有完整路径的文件名。这需要删除。
//var fileName=Path.GetFileName(file.fileName);
//var physicalPath=Path.Combine(Server.MapPath(“~/App\u Data”),文件名);
//这些文件实际上并未保存在此演示中
//file.SaveAs(物理路径);
}
}
//返回一个空字符串表示成功
返回内容(“”);
}
但是当我尝试调试这个时,控制器中的参数文件总是==null


有人能帮我确定问题所在吗?

将您的保存方法参数类型更改为
IEnumerable files
将您的保存方法参数类型更改为
IEnumerable files

问题在跨域中。据我所知,剑道不能上传文件到另一个域。问题是在跨域。据我所知,剑道不能上传文件到另一个域。不适合我。切换到IEnumerable后仍然为空。对我不起作用。切换到IEnumerable后仍为空。
public ActionResult Save(IEnumerable<HttpPostedFileBase> files)
    {
        // The Name of the Upload component is "files"
        if (files != null)
        {
            foreach (var file in files)
            {
                // Some browsers send file names with full path. This needs to be stripped.
                //var fileName = Path.GetFileName(file.FileName);
                //var physicalPath = Path.Combine(Server.MapPath("~/App_Data"), fileName);

                // The files are not actually saved in this demo
                // file.SaveAs(physicalPath);
            }
        }

        // Return an empty string to signify success
        return Content("");
    }