title: No 'Access-Control-Allow-Origin' header error on Angular file upload for files of certain size
body: <p>I currently am uploading a file to .NET Web API from an Angular front end.</p>
  
  <pre><code>uploadFile(file: File, customerId: number) {
    var formData: FormData = new FormData();
    formData.append('file', file, file.name);
    var headers = new HttpHeaders().set('Accept', 'application/json');
    var options = { headers: headers, reportProgress: true };
  
    const req = new HttpRequest('POST', 'customers/' + customerId + '/fileupload', formData, options)
    return this.http.request(req);
  } 
  </code></pre>
  
  <p>And the Web API route that receives this post.</p>
  
  <pre><code>[HttpPost]
  [Route("{customerId}/fileUpload")]
  public IHttpActionResult UploadFiles(int customerId)
  {
      if (HttpContext.Current.Request.Files.Count &gt; 0) 
      {
          _fileService.UploadFile(customerId, HttpContext.Current.Request.Files[0]);
          return Ok("Files Successfully Uploaded");
      } 
      else 
      {
          return Ok("0 Files Uploaded");
      }
  }
  </code></pre>
  
  <p>When I post a file that is 30,000,000 bytes (~30mb) or less, everything works as expected, but for some reason, when the file is larger, I get the error:</p>
  
  <pre><code>POST http://localhost:53319/customers/116/fileupload/Production 404 (Not Found)
  Failed to load http://localhost:53319/customers/116/fileupload/Production: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access. The response had HTTP status code 404.
  </code></pre>
  
  <p>For my case, I need to be able to upload files of up to 10 Gbs. Does anyone know why I get this error for files of larger than a  certain size and how I can fix it?</p>
  
  <p>I've done some research into this already, and all I've found is to add the following to the Web.config file, but hasn't solved the issue.</p>
  
  <pre><code>&lt;system.web&gt;
    &lt;httpRuntime maxRequestLength="2147483647" /&gt;
  &lt;/system.web&gt;
  </code></pre>