public ActionResult UploadFiles()
 {
     if (Request.Files.Count > 0)
     {
         try
         {
             HttpFileCollectionBase files = Request.Files;
             for (int i = 0; i < files.Count; i++)
             {
                 HttpPostedFileBase file = files[i];
                 var    ext      = Path.GetExtension(file.FileName);
                 string fname    = "Photo-" + Request.Form.Get("regNo") + ext;
                 string Newfname = Path.Combine(Server.MapPath("~/Uploads/"), fname);
                 addmissionService.UpdateImagePath(Convert.ToInt32(Request.Form.Get("regNo")), "/Uploads/" + fname);
                 file.SaveAs(Newfname);
             }
             return(Json("File Uploaded Successfully!"));
         }
         catch (Exception ex)
         {
             return(Json("Error occurred. Error details: " + ex.Message));
         }
     }
     else
     {
         return(Json("No files selected."));
     }
 }