C# 文件上载大小5 mb

C# 文件上载大小5 mb,c#,kendo-ui,C#,Kendo Ui,我使用剑道上传控制。在这里,我正在将文件发送给控制器。从那里我调用WebAPI mentod将文件保存到数据库中。现在我的问题是当我上传3mb文件时,它正在上传。如果我想上传超过3mb的文件,它不会上传。 我的控制器代码是这样的 byte[] fileData = null; //Fetches the uploaded file var httpPostedFileBase = Request.Files[0]; //Reads file data in Binary if (httpPost

我使用剑道上传控制。在这里,我正在将文件发送给控制器。从那里我调用WebAPI mentod将文件保存到数据库中。现在我的问题是当我上传3mb文件时,它正在上传。如果我想上传超过3mb的文件,它不会上传。 我的控制器代码是这样的

byte[] fileData = null;
//Fetches the uploaded file
var httpPostedFileBase = Request.Files[0];
//Reads file data in Binary
if (httpPostedFileBase != null)
using (var binaryReader = new BinaryReader(httpPostedFileBase.InputStream))
{
     fileData = binaryReader.ReadBytes(httpPostedFileBase.ContentLength);
}
//Create BO to save file in DB
var postedFileBase = Request.Files[0];
UploadFiles upload=new UploadFiles();
Docs doc = new Docs {ID = Id, Content = fileData};
if (postedFileBase != null) contractDoc.FileName = postedFileBase.FileName;

最后,我调用webapi调用。在webapi中,我发现了一个错误。

你应该先用谷歌搜索一下,你可以找到很多关于我的帖子,你看到了我给出的链接