title: Winform file uploader not uploading large files
body: <p>So im working on a .raw file uploader made in C# winform, and its working fine but any files a little bit above 2GB don't upload to the server.
  Im using the RestSharp library, heres the upload function</p>
  <pre><code>private void uploadfile(string filelocation)
          {
              
              output.AppendText(Environment.NewLine + DateTime.Now + $&quot; Start Uploading {filelocation}&quot;);
              string newfilelocation;
              if (nocopy.Checked) {
                  newfilelocation = filelocation;
  
              }
              else
              {
  
                  newfilelocation = Path.GetDirectoryName(filelocation) + @&quot;\temp\&quot; + Path.GetFileName(filelocation);
  
                  //check if a temp patch exits, create one if not.
                  string temppath = Path.GetDirectoryName(filelocation) + @&quot;\temp\&quot;;
  
                  bool exists = System.IO.Directory.Exists(temppath);
  
                  if (!exists)
                      System.IO.Directory.CreateDirectory(temppath);
  
                  if (File.Exists(newfilelocation))
                  {
                      File.Delete(newfilelocation);
                  }
  
                  try //for somereason, copy file fails sometimes...
                  {
                      File.Copy(filelocation, newfilelocation, true);
  
                  }
  
                  catch
                  {
                      output.AppendText(Environment.NewLine + DateTime.Now + $&quot; {newfilelocation} uploading failed once will try again&quot;);
  
                      System.Threading.Thread.Sleep(30000);
  
  
                      try //2nd try
                      {
                          File.Copy(filelocation, newfilelocation, true);
  
                      }
  
                      catch
                      {
                          output.AppendText(Environment.NewLine + DateTime.Now + $&quot; {newfilelocation} uploading failed second time&quot;);
  
                          return;
                      }
                      // Todo: Additional recovery here,
                      // like telling the calling code to re-open the file selection dialog
                  }
  
              }
  
              var client = new RestClient(txtserver.Text);
              client.Timeout = 30 * 60 * 1000;// 1000 ms = 1s, 30 min = 30*60*1000
  
              client.Authenticator = new HttpBasicAuthenticator(txtusername.Text, txtpassword.Text);
  
              if (!File.Exists(newfilelocation))
              {
                  MessageBox.Show(&quot;Please check file location&quot;);
                  return;
              }
  
              var request = new RestRequest();
  
              request.Method = Method.POST;
              request.AddHeader(&quot;Accept&quot;, &quot;application/json&quot;);
              request.Parameters.Clear();
              request.AddHeader(&quot;Content-Type&quot;, &quot;multipart/form-data&quot;);
              if(String.IsNullOrEmpty(txtsamplename.Text))
              {
                  request.AddParameter(&quot;run_name&quot;, Path.GetFileNameWithoutExtension(newfilelocation));
              }
              else
              {
                  request.AddParameter(&quot;run_name&quot;, txtsamplename.Text);
  
              }
  
              request.AddParameter(&quot;project_name&quot;, txtprojectname.Text);
              request.AddParameter(&quot;run_desc&quot;, txtdescription.Text);
              request.AddParameter(&quot;qc_tool&quot;, qctool.SelectedIndex);
              request.AddParameter(&quot;temp_data&quot;, TempData.Checked);
              request.AddFile(&quot;rawfile&quot;, newfilelocation);
              request.ReadWriteTimeout = 2147483647;
              request.Timeout = 2147483647;
              var response = client.Execute(request);
              output.AppendText(Environment.NewLine + response.Content);
              output.AppendText(Environment.NewLine + DateTime.Now + $&quot; {newfilelocation} uploaded&quot;);
              if (!nocopy.Checked)
              {
                  File.Delete(newfilelocation);
              }
          }
  </code></pre>
  <p>Wondering what solutions there could be so i can upload larger files. The server isnt the issue, since the files can be uploaded to the server using a browser extension. Its on the winform app side.</p>