tags:

views:

29

answers:

1

System.Web.UI.WebControls.FileUpload 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.

+2  A: 

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.

LorenVS
Thanks. I guess this threshold might be set in web.config?
Polymorphix