diff --git a/aspnetcore/fundamentals/minimal-apis/iformFile/7.0-samples/MinimalApi/Program.cs b/aspnetcore/fundamentals/minimal-apis/iformFile/7.0-samples/MinimalApi/Program.cs index 68aca797e7..11a8c8587b 100644 --- a/aspnetcore/fundamentals/minimal-apis/iformFile/7.0-samples/MinimalApi/Program.cs +++ b/aspnetcore/fundamentals/minimal-apis/iformFile/7.0-samples/MinimalApi/Program.cs @@ -1,6 +1,3 @@ -using Microsoft.AspNetCore.Http; -using System.IO; - var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); @@ -8,7 +5,8 @@ app.MapGet("/", () => "Hello World!"); app.MapPost("/upload", async (IFormFile file) => { - var tempFile = Path.GetTempFileName(); // or an existing custom file path + var tempFile = Path.GetTempFileName(); + app.Logger.LogInformation(tempFile); using var stream = File.OpenWrite(tempFile); await file.CopyToAsync(stream); }); @@ -17,7 +15,8 @@ app.MapPost("/upload_many", async (IFormFileCollection myFiles) => { foreach (var file in myFiles) { - var tempFile = Path.GetTempFileName(); // or an existing custom file path + var tempFile = Path.GetTempFileName(); + app.Logger.LogInformation(tempFile); using var stream = File.OpenWrite(tempFile); await file.CopyToAsync(stream); }