title: How can retrieve string formData js in c#
body: <p>I have to retrieve the value of "idPerson" in my web api in .net.
  I already retrieve the file "UploadedImage". But I can't retrieve the value of "idPerson".</p>
  
  <p>Someone have a solution?</p>
  
  <p>Thx !</p>
  
  <p>my js function</p>
  
  <pre><code>        /**
          * Upload de l'image de profil
          * @method uploadFile
          * @private
          */
          uploadFile: function () {
              var data = new FormData(), files, ajaxRequest;
  
              files = $("#fileUpload").get(0).files;
  
              // Ajout de l'image uploadé vers les données du form
              if (files.length &gt; 0) {
                  data.append("UploadedImage", files[0]);
                  // Ajout de l'id du patient pour calculer le GUID 
                  data.append("idPerson", this.vm.idPerson);
              }
  
              return data;
          },
  </code></pre>
  
  <p>my web api :</p>
  
  <pre><code> /// &lt;summary&gt;
      /// Méthode d'upload de la photo de profil du patient
      /// &lt;/summary&gt;
      /// &lt;returns&gt;Etat du téléchargement de l'image&lt;/returns&gt;
      public MessageOutCoreVm UploadImg()
      {
          string fileSavePath = string.Empty;
          string virtualDirectoryImg = "UploadedFiles";
          string fileName = string.Empty;
  
          if (HttpContext.Current.Request.Files.AllKeys.Any())
          {
              // Get the uploaded image from the Files collection
              var httpPostedFile = HttpContext.Current.Request.Files["UploadedImage"];
              fileName = httpPostedFile.FileName;
  
              if (httpPostedFile != null)
              {
                  // OBtient le path du fichier 
                  fileSavePath = Path.Combine(HttpContext.Current.Server.MapPath("~/UploadedFiles"), httpPostedFile.FileName);
  
                  // Sauvegarde du fichier dans UploadedFiles sur le serveur
                  httpPostedFile.SaveAs(fileSavePath);
              }
  
              return MessageOutCoreVm.SendSucces(virtualDirectoryImg + '/' + fileName);
          }
          else
          {
              return MessageOutCoreVm.SendValidationFailed("");
          }
      }
  </code></pre>