开发者

Uploading files with asp.net FileUpload. Buffering to disk before filling up memory?

开发者 https://www.devze.com 2023-01-20 19:49 出处:网络
System.Web.UI.WebControls.FileUploa开发者_JAVA百科d uses a FileInputStream when uploading files. Does this store everything in memory when uploading or does it start writing to disk after a certain bu

System.Web.UI.WebControls.FileUploa开发者_JAVA百科d uses a FileInputStream when uploading files. Does this store everything in memory when uploading or does it start writing to disk after a certain buffer size has been filled?

I know it used to work like that years ago, but I would think that has changed now... Can't find it in the docs though.


Some quick browsing through reflector seems to reveal that the FileUpload control makes use of an HttpInputStream instance.

Under the hood, HttpInputStream delegates work to an HttpRawUploadContent, which has a size threshold. Anything over that threshold gets pumped into a temporary file, anything below is handled entirely in memory.

0

精彩评论

暂无评论...
验证码 换一张
取 消