bjsomworker
New member
- Joined
- Jul 28, 2023
- Messages
- 2
- Programming Experience
- 3-5
Hi guys,
I am currently working with large file uploads in my Rest API, and have ready several comments saying that IFormFile should not be used with large files. I have found that it seams to work rather fine with large uploads. In fact, in the documentation found in the link below it is expressed that for files larger than 84kb (default), the file will be saved temporarily to disc. This shows responsiveness to deal with large files, not storing them in memory. In fact, when testing large file uploads with IFormFile, sending a file over 500MB, memory usage only showed to increase 7-8MB, which clearly shows that the application responds with a good way to deal with large files. When trying to implement a MultipartReader (recommended as a solution when working with large file uploads), it appeared to be much worse both in time consumption and memory consumption than using IFormFile.
I am a bit unsure of this topic, and need you guys' input.
Microsoft should document this more clearly, and many comments I have seen does not prove their statement, so I highly appreciate all feedback from this community.
I am currently working with large file uploads in my Rest API, and have ready several comments saying that IFormFile should not be used with large files. I have found that it seams to work rather fine with large uploads. In fact, in the documentation found in the link below it is expressed that for files larger than 84kb (default), the file will be saved temporarily to disc. This shows responsiveness to deal with large files, not storing them in memory. In fact, when testing large file uploads with IFormFile, sending a file over 500MB, memory usage only showed to increase 7-8MB, which clearly shows that the application responds with a good way to deal with large files. When trying to implement a MultipartReader (recommended as a solution when working with large file uploads), it appeared to be much worse both in time consumption and memory consumption than using IFormFile.
I am a bit unsure of this topic, and need you guys' input.
Microsoft should document this more clearly, and many comments I have seen does not prove their statement, so I highly appreciate all feedback from this community.

Upload files in ASP.NET Core
How to use model binding and streaming to upload files in ASP.NET Core MVC.
learn.microsoft.com