views:

34

answers:

2

I'm using ASP.NET for file uploads, and I'm hitting a bit of a snag in that data sent by the client as multipart form data is read straight into RAM.

Obviously, this means maximum file upload size is limited to the available RAM on the machine, and even then is much smaller as soon as you have multiple simultaneous uploads.

Is it possible to get ASP.NET to write the data to a temporary file on the hard drive as it is recieved rather than reading into RAM?

A: 

Personally I use NeatUpload http://neatupload.codeplex.com/. It is a custom HttpHandler that writes large uploads to disk. Maximum file size supported is 4GB.

Additionally, it displays a progress bar when the upload is in progress, so that large uploads will not seem hanged.

Li Huan
+2  A: 

ASP.NET saves uploaded data to a temporary file upon reach of requestLengthDiskThreshold:

http://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.requestlengthdiskthreshold.aspx

sfedor
Oh wow, thanks :)
Charlie Somerville