What is the byte to mb converstion to set MaxRequestBodySize in IISServerOptions

Matthew Dillon 1 Reputation point
2022-05-09T13:18:40.997+00:00

We attempted to set IISServerOptions.MaxRequestBodySize to 6MB but this did not work and is preventing files smaller than 6MB from being uploaded. example code below

public static void SetIISServerOptions(ServiceRegistry services)
{
var sixMegaBytesSize = 6291456;
services.Configure<IISServerOptions>(options =>
{
options.MaxRequestBodySize = sixMegaBytesSize;
});
}

If the conversation is not binary or decimal then what is the byte to mb conversation for MaxRequestBodySize. we are using core 3 and iis7.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,371 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 61,026 Reputation points
    2022-05-09T15:49:54.79+00:00

    the hander used to process the request may also have max request size setting

    0 comments No comments