Deployment Guide
Get CoreUpload running in your ASP.NET Core application in minutes.
1
Install the NuGet Package
Add CoreUpload to your project via the .NET CLI or NuGet Package Manager.
dotnet add package CoreUpload Or search for CoreUpload in Visual Studio's NuGet Package Manager.
2
Configure Program.cs
Register CoreUpload services, middleware, and endpoints in your application's startup pipeline.
var builder = WebApplication.CreateBuilder(args);
// Add CoreUpload services
builder.Services.AddCoreUpload();
builder.Services.AddRazorPages();
var app = builder.Build();
// Enable CoreUpload middleware
app.UseCoreUpload();
app.UseStaticFiles();
app.UseRouting();
// Map CoreUpload endpoints
app.MapCoreUploadEndpoints();
app.MapRazorPages();
app.Run(); 3
Use the Tag Helper in Razor Pages
Add the CoreUpload Tag Helper to any Razor Page to render the upload component.
<core-upload asp-upload-url="/api/upload/upload"
asp-extensions=".jpg,.png,.gif,.pdf,.zip"
asp-max-size="10MB"
asp-multiple="true"
asp-progress="true"
asp-drop-zone="true"
asp-thumbnails="true">
</core-upload> Make sure your _ViewImports.cshtml includes @addTagHelper *, CoreUpload.
4
Kestrel: Max Request Body Size
By default, Kestrel limits request bodies to approximately 28 MB. Increase this limit for large file uploads.
builder.WebHost.ConfigureKestrel(options =>
{
// Set max request body size to 500 MB
options.Limits.MaxRequestBodySize = 524288000;
}); 5
IIS: web.config Configuration
When hosting behind IIS, configure maxAllowedContentLength in your web.config to allow large uploads.
<configuration>
<system.webServer>
<security>
<requestFiltering>
<!-- 500 MB in bytes -->
<requestLimits maxAllowedContentLength="524288000" />
</requestFiltering>
</security>
</system.webServer>
</configuration>