title: UploadFileAsync not asynchronous?
body: <p>Aight, did a bit of Googling and searching here, the only question I found related was <a href="https://stackoverflow.com/questions/1542957/why-my-webclient-upload-file-code-hangs">this</a>, although the only answer it had wasn't marked as accepted, is old and is confusing.</p>
  
  <p>My problem is basically what I've said in the title. What happens is that the GUI freezes while the upload is in progress. My code:</p>
  
  <pre><code>// stuff above snipped
  
  public partial class Form1 : Form
  {
      WebClient wcUploader = new WebClient();
  
      public Form1()
      {
          InitializeComponent();
  
          wcUploader.UploadFileCompleted += new UploadFileCompletedEventHandler(UploadFileCompletedCallback);
          wcUploader.UploadProgressChanged += new UploadProgressChangedEventHandler(UploadProgressCallback);
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
          if (openFileDialog1.ShowDialog() == DialogResult.OK)
          {
              string toUpload = openFileDialog1.FileName;
              wcUploader.UploadFileAsync(new Uri("http://anyhub.net/api/upload"), "POST", toUpload);
          }
      }
  
      void UploadFileCompletedCallback(object sender, UploadFileCompletedEventArgs e)
      {
          textBox1.Text = System.Text.Encoding.UTF8.GetString(e.Result);
      }
  
      void UploadProgressCallback(object sender, UploadProgressChangedEventArgs e)
      {
          textBox1.Text = (string)e.UserState + "\n\n"
              + "Uploaded " + e.BytesSent + "/" + e.TotalBytesToSend + "b (" + e.ProgressPercentage + "%)";
      }
  }
  </code></pre>
  
  <p><b>EDIT:</b> For clarification, this is what happens in order:</p>
  
  <ol>
  <li>I click button1</li>
  <li>I select a file</li>
  <li>The GUI stops responding, as in when I click on it nothing happens</li>
  <li>After a couple of seconds 50% shows up in the textbox <strong>Aaand the realisation hits. See my comment to the question I marked as the solution</strong></li>
  <li>After a second or so with the GUI not responding in-between it's replaced with the response</li>
  </ol>