Form submit resulting in “InvalidDataException: Form value count limit 1024 exceeded.”

前端 未结 4 1487
广开言路
广开言路 2020-12-05 17:01

I have created an mvc site and I\'m posting a large amount of json form data (Content-Type:application/x-www-form-urlencoded) back to the mvc controller. When I

4条回答
  •  抹茶落季
    2020-12-05 17:56

    In my case, it worked by changing ValueLengthLimit, in Startup.cs file

    public void ConfigureServices(IServiceCollection services)
    {
        services.Configure(options =>
        {
            options.ValueCountLimit = 200; // 200 items max
            options.ValueLengthLimit = 1024 * 1024 * 100; // 100MB max len form data
        });
    

提交回复
热议问题