title: Webclient upload file - internal server error 500
body: <p>I have been trying to emulate the following cURL command through the following C# code:</p>
  
  <pre><code>curl.exe –v –u user:pwd –XPOST –T "file1.txt" –H "Content-Type:text/plain" "http://example.com/xx/xx/xx/insert"
  </code></pre>
  
  
  
  <pre><code>string url = "http://example.com/xx/xx/xx/insert";
  string fileName = @"file1.txt";
  
  var client = new WebClient();
  client.Credentials = new NetworkCredential("user", "pwd");
  client.Headers.Add("Content-Type", "text/plain");         
  byte[] responseBinary = client.UploadFile(url, "POST", fileName);
  string response = Encoding.UTF8.GetString(responseBinary);
  </code></pre>
  
  <p>It gives me an "Internal server error 500". I think the server which I am trying to upload to is a PHP server. How should I proceed to debug?</p>