Description
User feedack transferred from UUF system:
"IISServerOptions is not documented in the IIS section while it also has options impacting file upload size restrictions. Same for IHttpMaxRequestBodySizeFeature"
[AI assisted problem/solution detail follows]
Feedback on File Uploads documentation: Missing IISServerOptions and IHttpMaxRequestBodySizeFeature information
The problem:
- IISServerOptions.MaxRequestBodySize is briefly mentioned, but lacks context about how it interacts with other IIS limits
- IHttpMaxRequestBodySizeFeature is not mentoned at all but should be
Suggested improvements:
- Expand the IIS section to provide more details about IISServerOptions.MaxRequestBodySize and clarify how it interacts with the IIS maxAllowedContentLength setting
- Add documentation about IHttpMaxRequestBodySizeFeature, explaining how it can be used to modify request body size limits for specific requests
- Include a code example showing how to use IHttpMaxRequestBodySizeFeature in practice
Proposed code example to add:
// Example showing how to use IHttpMaxRequestBodySizeFeature for a specific request
app.Use(async (context, next) =>
{
// For a specific endpoint that needs a larger size limit
if (context.Request.Path.StartsWithSegments("/api/largefiles"))
{
// Get the feature from the request
var requestSizeFeature = context.Features.Get<IHttpMaxRequestBodySizeFeature>();
if (requestSizeFeature != null && requestSizeFeature.IsReadOnly == false)
{
// Allow requests up to 100 MB for this specific endpoint
requestSizeFeature.MaxRequestBodySize = 104857600; // 100 MB
}
}
await next.Invoke();
});
Page URL
https://learn.microsoft.com/en-us/aspnet/core/mvc/models/file-uploads?view=aspnetcore-9.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/mvc/models/file-uploads.md
Document ID
c6787f0f-3e9a-6efb-0e6e-5ccb957d3f4a
Platform Id
a281e7a8-71e2-c3ec-e6dc-c5c6161ae486
Article author
@tdykstra
Metadata
- ID: 9a5cfa38-0e6c-4346-dafc-84ea5c513fcf
- PlatformId: a281e7a8-71e2-c3ec-e6dc-c5c6161ae486
- Service: aspnet-core
- Sub-service: mvc
Related Issues
Description
User feedack transferred from UUF system:
"IISServerOptions is not documented in the IIS section while it also has options impacting file upload size restrictions. Same for IHttpMaxRequestBodySizeFeature"
[AI assisted problem/solution detail follows]
Feedback on File Uploads documentation: Missing IISServerOptions and IHttpMaxRequestBodySizeFeature information
The problem:
Suggested improvements:
Proposed code example to add:
Page URL
https://learn.microsoft.com/en-us/aspnet/core/mvc/models/file-uploads?view=aspnetcore-9.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/mvc/models/file-uploads.md
Document ID
c6787f0f-3e9a-6efb-0e6e-5ccb957d3f4a
Platform Id
a281e7a8-71e2-c3ec-e6dc-c5c6161ae486
Article author
@tdykstra
Metadata
Related Issues