IForm post /2
parent
bd331c43d4
commit
49de15fef5
|
@ -0,0 +1,9 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,23 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
var builder = WebApplication.CreateBuilder();
|
||||
|
||||
builder.Services.AddAntiforgery();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
//app.UseAntiforgery();
|
||||
|
||||
app.MapPost("/upload", ([FromForm] DocumentUpload document) =>
|
||||
{
|
||||
return Results.Ok();
|
||||
});
|
||||
|
||||
app.Run();
|
||||
|
||||
public class DocumentUpload
|
||||
{
|
||||
public string Name { get; set; } = "Uploaded Document";
|
||||
public string? Description { get; set; }
|
||||
public IFormFile? Document { get; set; }
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
Loading…
Reference in New Issue