public JsonResult UploadFile()
 {
     var status = false;
     HttpPostedFileBase myFile = null;
     if (Request.Files.Count > 0) myFile = Request.Files[0];
     if (myFile != null && myFile.ContentLength != 0)
     {
         var userID = UserDetail.UserId;
         string pathForSaving = Server.MapPath("~/DocumentsUpload");
         if (SharedFunction.CreateFolderIfNeeded(pathForSaving))
         {
             try
             {
                 string fileName = DateTime.Now.ToString("MMddyyyyHHmmss") + Path.GetExtension(myFile.FileName);
                 myFile.SaveAs(Path.Combine(pathForSaving, fileName));
                 string path = "~/DocumentsUpload/" + fileName;
                 var profileManager = new ProfileSettingManager();
                 status = profileManager.AddFile(userID, path, myFile.FileName);
             }
             catch (Exception ex)
             {
                 return Json(ex.InnerException);
             }
         }
     }
     return Json(status);
 }