title: Post request body too large (string in parameter object too large)
body: <p>I have an MVC method:</p>
  
  <pre><code>public void PushFile([FromBody]FileTransport fileData)
  </code></pre>
  
  <p>Class is:</p>
  
  <pre><code>public class FileTransport
      {
          public string fileData;
      }
  </code></pre>
  
  <p>In fileData I put <code>byte[]</code> from a file converted into a <code>string</code> (UTF-8), so the string can be large.</p>
  
  <p>Problem is: if the string is <strong>too</strong> large (somewhere above 15000 characters) the <code>fileData</code> parameter is <code>null</code>. If the string is not that large, everything works fine and the parameter is as it should be.</p>
  
  <p>How can I allow MVC to accept larger strings, or do I need to compress the string somehow beforehand?
  EDIT:
  Already tried:</p>
  
  <pre><code>&lt;system.web.extensions&gt;
  &lt;scripting&gt;
    &lt;webServices&gt;
      &lt;jsonSerialization maxJsonLength="2147483644"/&gt;
    &lt;/webServices&gt;
  &lt;/scripting&gt;
  &lt;/system.web.extensions&gt;
  </code></pre>
  
  <p>But does not work. Maybe because MVC uses JSON.NET instead of the normal JsonSerializer?</p>