From aeca21358f5940032dffa8e4e760ff0d44e566bf Mon Sep 17 00:00:00 2001 From: Rick Anderson <3605364+Rick-Anderson@users.noreply.github.com> Date: Wed, 16 Mar 2022 09:36:19 -1000 Subject: [PATCH] File uploads buffers in temp directory /2 (#25323) * File uploads buffers in temp directory /2 * Update aspnetcore/mvc/models/file-uploads.md Co-authored-by: Chris Ross Co-authored-by: Chris Ross --- aspnetcore/mvc/models/file-uploads.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/aspnetcore/mvc/models/file-uploads.md b/aspnetcore/mvc/models/file-uploads.md index ab4f577bfe..a9a5d2efc7 100644 --- a/aspnetcore/mvc/models/file-uploads.md +++ b/aspnetcore/mvc/models/file-uploads.md @@ -86,12 +86,13 @@ Two general approaches for uploading files are buffering and streaming. **Buffering** -The entire file is read into an , which is a C# representation of the file used to process or save the file. +The entire file is read into an . `IFormFile` is a C# representation of the file used to process or save the file. -The resources (disk, memory) used by file uploads depend on the number and size of concurrent file uploads. If an app attempts to buffer too many uploads, the site crashes when it runs out of memory or disk space. If the size or frequency of file uploads is exhausting app resources, use streaming. +The disk and memory used by file uploads depend on the number and size of concurrent file uploads. If an app attempts to buffer too many uploads, the site crashes when it runs out of memory or disk space. If the size or frequency of file uploads is exhausting app resources, use streaming. -> [!NOTE] -> Any single buffered file exceeding 64 KB is moved from memory to a temp file on disk. +Any single buffered file exceeding 64 KB is moved from memory to a temp file on disk. + +Temporary files for larger requests are written to the location named in the `ASPNETCORE_TEMP` environment variable. If `ASPNETCORE_TEMP` is not defined, the files are written to the current user's temporary folder. Buffering small files is covered in the following sections of this topic: