ASP.NET supports uploading one or more files using buffered model binding for smaller files and unbuffered streaming for larger files.
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.
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.
So it depends on the number and file sizes, if they are buffered in the memory they will clean after the request is finished (something like request scoped) if they are saved into a temp path then they will be removed by OS.
For more detail check this link: https://learn.microsoft.com/en-us/aspnet/core/mvc/models/file-uploads?view=aspnetcore-7.0