Here's the code I use to solve the need to redirect. This code populates the _contentAvailLength, _contentTotalLength, _preloadedContent, and _preloadedContentRead properties that .NET uses to track the expected length of the request. private byte[] PopulateRequestData(HttpWorkerRequest
hwr, byte[] data) { BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.NonPublic; Type type = hwr.GetType().BaseType; int i = (int)data.Length; type.GetField("_contentAvailLength", bindingFlags).SetValue(inWR, i); type.GetField("_contentTotalLength",
bindingFlags).SetValue(inWR, i); type.GetField("_preloadedContent", bindingFlags).SetValue(inWR, inData); type.GetField("_preloadedContentRead", bindingFlags).SetValue(inWR, true); }
Hello CodeRage/ups101/All, I'm tryin to stop the Upload process in between I tried with context.Response.buffer=true; context.Response.clear(); context.Response.end(), its not working. Can anyone help me on that. With Regards, Mdu
Ok, I'm back again. I've been working on the upload handler the last few weeks and got it all figured out. To give you an idea of the complexity of the subject, I'll list the classes I used to get it all working. 1. The uploadHandler -> handles all incomming
requests on IIS and triggers if it encounters Multipart-formdata stuff 2. The UploadDataProvider -> A class I wrote to get all the data posted during the request, it contains a method that passes the whole request byte per byte. Very usefull for parsing the
request. 3. The UploadProgress -> A class to keep track of the status of the upload. An instance of this object is created at the beginning of the request and is used to store all the info about the upload in progress. 4. UploadedFiles -> Contains a ArrayList
of all the files uploaded (ArrayList of UploadedFile) 5. UpoadedFile -> Contains all the information about the files that were uploaded. As you can see, it's not as easy as we think it is. If I get my code working in a stable way I'll let you guys know.
Bjorn.B, Wow... We r all waitin for your great code here... Just 1 question: How do I stop execution in the middle of current HTTP module(upload)? Let me know your email id too. Thanks a lot. MDU
I have tried to implemented two custom versions of the algorthm stated in this thread for stripping the form content of forms into a text file. I have even ran a copy of the code that was posted on this thread. I am getting a problem where the response hangs
on the server. GetPreloadedEntityBody() is fine - but ReadEntityBody(...) calls consistantly return 0 and if I manually press stop on my browser while testing the transfer goes through without a hitch. I have including several versions of flushing and redirection
etc. and nothing seems to work. I am obviously missing something simple. I have the parsing and even progress indicator - but I still have to give it a kick after I click submit for things to start rolling. It boggles my mind how a product like .net would
make the implementation of this so cryptic that it takes until late 2002 for the community to get a publicly workable solution. Oh BTW - thanks for the hard work! -Goyaman
Goyaman> Are you sure you're not reading past the length of the request? If you call ReadEntityBody with a value larger than what is available, the server will hang. This is because the process is waiting for the rest of the bytes to read - or some solid confirmation
that the bytes are not coming, like the client pressing stop. So the solution is to only read as much as you have available - and not less than that either, as this will also cause problems (my experience at least). I believe the proposed code from coderage
retrieves the length of the request by parsing the Request-Length header. Regards, Rasmus
i388
Member
15 Points
3 Posts
Re: HttpHandler or HttpModule for file upload, large files, progress indicator?
Jan 13, 2003 12:24 AM|LINK
dredman
Member
10 Points
2 Posts
Re: HttpHandler or HttpModule for file upload, large files, progress indicator?
Jan 13, 2003 11:29 AM|LINK
ups101
Member
205 Points
41 Posts
Re: HttpHandler or HttpModule for file upload, large files, progress indicator?
Jan 13, 2003 01:57 PM|LINK
MaduriKaran
Member
40 Points
8 Posts
Re: HttpHandler or HttpModule for file upload, large files, progress indicator?
Jan 14, 2003 02:04 PM|LINK
MaduriKaran
Member
40 Points
8 Posts
Re: HttpHandler or HttpModule for file upload, large files, progress indicator?
Jan 15, 2003 02:00 PM|LINK
i388
Member
15 Points
3 Posts
Re: HttpHandler or HttpModule for file upload, large files, progress indicator?
Jan 21, 2003 02:38 AM|LINK
Bjorn.B
Member
10 Points
2 Posts
Re: HttpHandler or HttpModule for file upload, large files, progress indicator?
Jan 21, 2003 07:40 AM|LINK
MaduriKaran
Member
40 Points
8 Posts
Re: HttpHandler or HttpModule for file upload, large files, progress indicator?
Jan 23, 2003 09:12 PM|LINK
goyaman
Member
35 Points
7 Posts
Re: HttpHandler or HttpModule for file upload, large files, progress indicator?
Feb 11, 2003 10:15 PM|LINK
ups101
Member
205 Points
41 Posts
Re: HttpHandler or HttpModule for file upload, large files, progress indicator?
Feb 13, 2003 07:45 PM|LINK