public ActionResult SocietyMemberDetails(FormCollection fc, IEnumerable <HttpPostedFileBase> files) { ByeLawsModel objBL = new ByeLawsModel(); ContentFileUploadModel objCFU = new ContentFileUploadModel(); try { int i = 4; foreach (var file in files) { if (file != null) { AttachmentType aa = new AttachmentType(); Stream str = file.InputStream; objCFU.File_Name = file.FileName; objBL.ByeLawsName = file.FileName; string extenstion = "pdf"; BinaryReader Br = new BinaryReader(str); byte[] FileDet = Br.ReadBytes((Int32)str.Length); string base64ImageRepresentation = Convert.ToBase64String(FileDet); objBL.Docs = base64ImageRepresentation; objCFU.ContentUpload = base64ImageRepresentation; objBL.SocietyTransID = Convert.ToString(Session["SocietyTransID"]); objCFU.USER_ID = Convert.ToInt32(Session["UserId"]); objCFU.SocietyTransID = Convert.ToString(Session["SocietyTransID"]); aa = GetMimeType(base64ImageRepresentation); objCFU.FormId = i; if (extenstion.IndexOf(aa.Extension.Replace(".", "")) < 0 || aa.Extension == "") { } else { Int64 filesizeallowedfor_FileUpload = 2048 * 5; if (file.ContentLength < filesizeallowedfor_FileUpload) { int a = objSSF.SaveContentFileUpload(objCFU); } } } i = i + 1; } List <SelectListItem> lstSL = new List <SelectListItem>(); List <SelectListItem> lstI = new List <SelectListItem>(); InspectorData objID = new InspectorData(); ForwardToARCSOfficers objFTAO = new ForwardToARCSOfficers { IncepectorCode = Convert.ToInt32(Session["InsceptorCode"]), SocietyTransId = Convert.ToString(Session["SocietyTransID"]), Remarks = fc.Get("ARCSRemarks").ToString() }; int result = objID.ForwardToARCS(objFTAO); if (result >= 1) { ViewBag.show = "Application successfully forwarded to incepector"; ViewBag.result = "1"; ViewBag.tabResult = "1"; } else { ViewBag.show = "Application not successfully forwarded to incepector"; ViewBag.result = "0"; ViewBag.tabResult = "0"; } lstSL = GetSocietyList(); ViewBag.lstSL = lstSL; } catch (Exception ex) { return(RedirectToAction("Error", "Unauthorised")); throw ex; } return(View()); }