0

I am using kendo upload control. Here iam sending the file to controller. From there i am calling web api mentod to save the file in to database. Now my problem is when i upload 3mb file it is uploading. If i want upload more than 3mb file its not uploading. My Controller code is like this.

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;

Finally i am calling the webapi call. In webapi i got error.

prasadd
  • 324
  • 2
  • 6

0 Answers0