title: File Upload using Chatter REST API
body: <p>I read documentation of Salesforce Chatter REST API and started to implement code in c#.
  See following code:</p>
  
  <pre><code>System.Net.WebRequest req = System.Net.WebRequest.Create(URI);
          req.Method = "POST";
          req.Headers.Add("Authorization: OAuth " + accessToken);
          req.ContentType = "application/x-www-form-urlencoded";
          string par = 
                 "fileName=" + fileName +
              "&amp;feedItemFileUpload="                
             + @"D:\\MyFiles\\NewTextDocument.txt" +                  
                       "&amp;desc=" + desc+
                       "&amp;text=" + text;
  
          byte[] byteArray = Encoding.UTF8.GetBytes(par);
          req.ContentLength = byteArray.Length;
          Stream dataStream = req.GetRequestStream();
          dataStream.Write(byteArray, 0, byteArray.Length);
          dataStream.Close();
  
          System.Net.WebResponse resp = req.GetResponse();
  </code></pre>
  
  <p>I am gettig error on response
  <strong>The remote server returned an error: (400) Bad Request.</strong></p>
  
  <p>If i see response of error, i got following message:</p>
  
  <p><strong>Please specify a file to upload. Type in the path to the file, or use the \"Browse\" button to locate it in your local filesystem.</strong></p>
  
  <p>I have already defined the file path and name. I tried with and without @ sign before path string but getting same error.  Let me know if anything is missing.</p>