I'm actually using global.asax, but the code seems to be similar to working in an HttpModule (and I may end up moving it to one) so I'm posting here. My first post on this site.
I'm using ??????HttpWorkerRequest.ReadEntityBody to get at the request stream as it comes off the wire, instead of waiting for the entire upload to complete and let a normal aspx page handle it. These file uploads can be up to 2 GB and I need to compress (and maybe encrypt) them, and for various reasons I want this to be done as the file uploads instead of waiting until done.
The files are coming via post data in multipart/form-data format, either from the SWFUpload control or a normal ASPX file upload control.
I have some mostly working code that manually reads the stream in small buffers and watches for the start of the actual file data and then starts writing that part to a file using a compression stream. I haven't added code to watch for the MIME boundary marker at the end of the file content yet though, and already the code seems overly complex. So I'm wondering what others have done, and if .NET has anything to make it easier to work with this multipart/form-data format other than the Request.Form methods, because it seems that using any of those causes the code to hang until the entire upload is complete (I'm guessing so that the ASP.NET
View Complete Post