Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed large payload issue in large documents #18

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ASP.NET Core/PdfViewerWebService_5.0/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.ResponseCompression;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
Expand All @@ -27,6 +28,7 @@ public Startup(IConfiguration configuration)
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.Configure<KestrelServerOptions>(options => options.Limits.MaxRequestBodySize = 52428800);
services.AddControllers();
services.AddMemoryCache();
services.AddControllers().AddNewtonsoftJson(options =>
Expand Down
10 changes: 10 additions & 0 deletions ASP.NET Core/PdfViewerWebService_5.0/web.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483647" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
6 changes: 6 additions & 0 deletions ASP.NET Core/PdfViewerWebService_6.0 - Minimal API/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
});
});

// Configure Kestrel options
builder.WebHost.ConfigureKestrel(options =>
{
options.Limits.MaxRequestBodySize = 52428800; // 50 MB
});

builder.Services.AddMemoryCache();
builder.Services.AddEndpointsApiExplorer();

Expand Down
10 changes: 10 additions & 0 deletions ASP.NET Core/PdfViewerWebService_6.0 - Minimal API/web.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483647" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
6 changes: 6 additions & 0 deletions ASP.NET Core/PdfViewerWebService_6.0/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
});
});

// Configure Kestrel options
builder.WebHost.ConfigureKestrel(options =>
{
options.Limits.MaxRequestBodySize = 52428800; // 50 MB
});

builder.Services.AddMemoryCache();
builder.Services.AddEndpointsApiExplorer();

Expand Down
10 changes: 10 additions & 0 deletions ASP.NET Core/PdfViewerWebService_6.0/web.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483647" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
});
});

// Configure Kestrel options
builder.WebHost.ConfigureKestrel(options =>
{
options.Limits.MaxRequestBodySize = 52428800; // 50 MB
});

builder.Services.AddMemoryCache();
builder.Services.AddEndpointsApiExplorer();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483647" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
8 changes: 8 additions & 0 deletions ASP.NET MVC/MvcWebService_4.6/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<namespaces>
</namespaces>
</pages>
<!-- Size in KB (50 MB) -->
<httpRuntime maxRequestLength="51200" />
</system.web>
<system.webServer>
<httpProtocol>
Expand All @@ -25,6 +27,12 @@
<add name="Access-Control-Max-Age" value="1728000" />
</customHeaders>
</httpProtocol>
<security>
<requestFiltering>
<!-- Size in Bytes (50 MB) -->
<requestLimits maxAllowedContentLength="52428800" />
</requestFiltering>
</security>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true" />
<handlers>
Expand Down
8 changes: 7 additions & 1 deletion ASP.NET MVC/MvcWebService_4.8/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<startup useLegacyV2RuntimeActivationPolicy="true">
</startup>
<system.web>
<httpRuntime requestValidationMode="2.0" />
<httpRuntime requestValidationMode="2.0" maxRequestLength="51200" />
<compilation debug="true" targetFramework="4.8">
<assemblies>
</assemblies>
Expand All @@ -25,6 +25,12 @@
<add name="Access-Control-Max-Age" value="1728000" />
</customHeaders>
</httpProtocol>
<security>
<requestFiltering>
<!-- Size in Bytes (50 MB) -->
<requestLimits maxAllowedContentLength="52428800" />
</requestFiltering>
</security>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
Expand Down
Loading