title: Asp.net Core 2.0 RequestSizeLimit attribute not working
body: <p>I'm creating a website in Asp.net core 2.0 which allows files to be uploaded.  I quickly came across the problem of the <code>30MB</code> upload limit and receive a <code>404</code> response from the server.  Below this limit everything works fine.</p>
  
  <p>I found a number of solutions on the web like this one:
  <a href="https://stackoverflow.com/questions/38698350/increase-upload-file-size-in-asp-net-core">Increase upload file size in Asp.Net core</a>. My problem is that I cannot get this solution to work and I'm still getting the <code>404</code> response when over <code>30MB</code>.</p>
  
  <p>My call is an ajax one and goes like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>function uploadMedia(isPhoto, files) {
    var type;
    if (isPhoto) {
      type = "i";
    } else {
      type = "v";
    }
  
    var data = new FormData();
    if (files.length &gt; 0) {
      for (idx = 0; idx &lt; files.length; idx++) {
        if (files[idx].size &lt; 1074790400) {
          data.append("fileImage" + idx, files[idx]);
        } else {
          BootstrapDialog.show({
            type: BootstrapDialog.TYPE_WARNING,
            title: "Validation Error",
            message: "The maximum file size for images is 1GB. Please resize your image and upload again.",
            buttons: [
              {
                label: "OK",
                action: function(dialogItself) {
                  dialogItself.close();
                }
              }
            ]
          });
        }
      }
  
      $.ajax({
        url: "/api/article/uploadfile/" + type,
        type: "POST",
        processData: false,
        contentType: false,
        dataType: false,
        data: data,
        success: function(jsonData) {
          refreshUploadedImages(jsonData, isPhoto);
        }
      });
    }
  }
  
  function rotateImageAnticlockwise(element) {
    var id = $(element).attr("data-id");
    var mediaData = getMediaData(id, true);
  
    $.ajax({
      url: "/api/article/rotateMedia/a/p/" + mediaData.fileId + "/" + mediaData.rotation,
      type: "POST",
      processData: false,
      contentType: false,
      success: function(jsonData) {
        refreshRotatedImage(jsonData);
      }
    });
  }
  </code></pre>
  
  <p>Then my server-side method has attributes like this:</p>
  
  <pre><code>[HttpPost]
  [RequestSizeLimit(1074790400)]
  [Route("api/article/uploadfile/{mediaType}")]
  public async Task&lt;IActionResult&gt; UploadFile(string mediaType)
  </code></pre>
  
  <p>Can anyone see what I'm doing wrong?  This is driving me mad!!!</p>