473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

HttpModule and file upload

Hi folks,
I wrote a HttpModule to handle file uploads (on beginRequest) prior to the
actual web form displaying the result.
The file upload processing generally works very well also for large files,
however it may fail for any unpredictable reason. If it fails I want to
invoke a context.response.redirect to the same url. This should result in a
simple GET request which passes my module without further attention.
I notice the following behavior:
1. I invoke the upload from the browser
2. The module intercepts the http POST, casts to a httpworkerprocess object
and calls GetKnownRequestHeader for the total length of the request
3. I cause an error within the module (intentionally), catch it NOT
processing any upload code
4. the context.response.redirect is executed
5. it takes a very long time (related to file size) until module is
revisited with the GET request
6. my page displays with the error caused before (this is correct)

Obviously, the file attachment has been uploaded to any memory location (?)
although I exited immediately and did not process my upload code. Ethereal
tells me that actually the file data has been completely uploaded to the
server??!

Can anyone explain how this can happen? Does access to any intrinsic
workerrequest object or the call to context.response.redirect mean that the
complete request including the file is (pre)loaded?

What I want is invoking the client redirect immediately on an error in my
HttpModule without loading the complete file attachment or the rest of it.

Anyone?

Thank you,
Andy
Nov 20 '06 #1
0 1381

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bruce B | last post by:
Hi group, I'm experiencing some extreme weirdness over the last week with IIS related to it's Mappings and how .NET is behaving. I can't explain the behavior as it seems very random. Our...
3
by: parthivjoshi | last post by:
Do anyone have the idea how to add progressbar to the existing HTTPModule and HTTPApplication for File Upload. ********************************************************************** Sent via...
1
by: Ryan Cromwell | last post by:
I have written an httpModule for use in our test environment. If a user goes to http://testserver/SomeApplication/MyPage.aspx it will resolve to the latest version of that application deployed:...
3
by: ypul | last post by:
Hi, am using httpmodule in my application. now <configuration> <system.web> <httpModules>
4
by: | last post by:
I have earlier used an HttpModule that did URL rewrites on the BeginRequest event. Now I am trying to use the same module in a different application on a new and upgraded machine (winxp sp2). ...
0
by: Vitali Dzz via .NET 247 | last post by:
Hello I need some help I need to write a code that analyze size of the uploaded file. I wrote such HttpModule: public void BeginRequest(object sender, EventArgs args) { // Create an...
1
by: Li Zhang | last post by:
Hi guys, I am trying to write a httpmodule to implement upload file progress bar. I searched web and got some sample code from code project...
2
by: Simon-Pierre Jarry | last post by:
Hi, I created a custom HttpModule for managing the security of my application. in "Init" sub, I regsiter the events doing that : Public Sub Init(ByVal context As System.Web.HttpApplication)...
2
by: daokfella | last post by:
With the vast amount of large file upload controls out there, which one do you feel is the best? My site needs to support frequent large file uploads (up to 100Mb). I'd also like to be able to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.