title: how to edit the attachment file in ASP.net MVC4
body: <p>I have created a list of project in CRUD operation, in which I have successfully created a list of projects with uploading attachment. My problem is that when I update the project list. I am unable to read the inserted file and unable to upload the attachment file.</p>
  
  <h2>Businees Access Layer Code is</h2>
  
  <pre><code>public bool UpdateProject(ProjectInfoModel upd)
      {
          try
          {
              int ProjectID = upd.ProjectID;
              string ProjectCode = upd.ProjectCode;
              string ProjectName = upd.ProjectName;
              int ProjectTechnologiesID = upd.ProjectTechnologiesID;
              int ProjectEngagementModelID = upd.ProjectEngagementModelID;
              int ClientID = upd.ClientID;
              DateTime ProjectStartDate = upd.ProjectStartDate;
              DateTime ProjectEndDate = upd.ProjectEndDate;
              string Remarks = upd.Remarks;
              DateTime CreatedDateTime = upd.CreatedDateTime;
              int CreatedBy = upd.CreatedBy;
              int LastModifiedBy = upd.LastModifiedBy;
              DateTime LastModifiedDateTime = upd.LastModifiedDateTime;
              string ProjectStatus = upd.ProjectStatus;
  
              int ProjectLeadID = upd.ProjectLeadID;
              int AccountManagerID = upd.AccountManagerID;
  
              // below code for stored procedure
  
              DB.ProjectUpdate(ProjectID, ProjectCode, ProjectName, ProjectTechnologiesID, ProjectEngagementModelID, ClientID, ProjectStartDate, ProjectEndDate, Remarks, CreatedDateTime, CreatedBy, LastModifiedBy, LastModifiedDateTime, ProjectStatus, ProjectLeadID, AccountManagerID);   
  
  
  
         }
          catch (Exception e)
          {
  
  
          }
          return true;
      }
  </code></pre>
  
  <hr>
  
  <p>Controller code is</p>
  
  <hr>
  
  <pre><code>public ActionResult UpdateProject(string id)
      {
         ProjectInfoModel pm = new ProjectInfoModel();
  
          try
          {
              pm = objPMSBAL.getproject(Convert.ToInt32(id));
              ViewBag.ClientID = new SelectList(objPMSBAL.ListClientId(), "ClientID", "ClientID");
              ViewBag.ProjectEngagementModelID = new SelectList(objPMSBAL.ListEngagementId(), "ProjectEngagementModelID", "ProjectEngagementModelID");
              ViewBag.ResourceID = new SelectList(objPMSBAL.ListResourceId(), "ResourceID", "ResourceID");
              ViewBag.TechnologyID = new SelectList(objPMSBAL.ListTechnologyId(), "ProjectTechID", "ProjectTechID");
  
          }
  
          catch (Exception e)
          {
  
  
          }
          return View(pm);
  
  
      }
  
  
      [HttpPost]
      public ActionResult UpdateProject(ProjectInfoModel UP)
      {
          if (ModelState.IsValid)
          {
  
  
             objPMSBAL.UpdateProject(UP);       // Calling BAL method
  
  
          }
  
          return RedirectToAction("ProjectList1");
      }
  </code></pre>
  
  <p>So I need help to solve my problem. Thank you in advance.</p>