title: Upload to Sharepoint using FrontPage RPC
body: <p>I am trying to upload documents with their metadata to sharepoint using the RPC method.<br>
  well it is working fine except some type of files like docx, xlsx..<br>
  I don't get any errors or exceptions, they are(docx, xlsx.) uploaded to sharepoint correctly but without the associated metadata.<br><br>
  <strong>How can i fix this problem?</strong></p>
  
  <p>Below is the code i use to upload with metadata:</p>
  
  <pre><code> private static bool Upload(string webUrl, string documentName, byte[] bytes, Dictionary&lt;string, object&gt; metaInfo, NetworkCredential netAccess, out string result)
      {
          string putOption = "overwrite,createdir,migrationsemantics";  // see http://msdn2.microsoft.com/en-us/library/ms455325.aspx
          string comment = null;
          bool keepCheckedOut = false;
          string method = "method=put+document%3a12.0.4518.1016&amp;service_name=%2f&amp;document=[document_name={0};meta_info=[{1}]]&amp;put_option={2}&amp;comment={3}&amp;keep_checked_out={4}\n";
          method = String.Format(method, documentName, EncodeMetaInfo(metaInfo), putOption, HttpUtility.UrlEncode(comment), keepCheckedOut.ToString().ToLower());
          List&lt;byte&gt; data = new List&lt;byte&gt;();
          data.AddRange(Encoding.UTF8.GetBytes(method));
          data.AddRange(bytes);
  
         try
          {
              using (WebClient webClient = new WebClient())
              {
                  webClient.Credentials = netAccess;
                  webClient.Headers.Add("Content-Type", "application/x-vermeer-urlencoded");
                  webClient.Headers.Add("X-Vermeer-Content-Type", "application/x-vermeer-urlencoded");
                  result = Encoding.UTF8.GetString(webClient.UploadData(webUrl + "/_vti_bin/_vti_aut/author.dll", "POST", data.ToArray()));
                  if (result.IndexOf("\n&lt;p&gt;message=successfully") &lt; 0)
                      throw new Exception(result);
              }
          }
          catch (Exception ex)
          {
              result = ex.Message;
              return false;
          }
          return true;
      }
  </code></pre>