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