locked
HttpWorkerRequest.ReadEntityBody REturns 0 Value RRS feed

  • Question

  • User619892963 posted
    Hi, I am trying to implement the uploading solution posted of the thread at http://asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=118390 , page 5, with regards to implementing a large upload solution in a httpHandler, instead of a httpmodule. I decided to try to implement thius, however, It works well until it reaches Received = hwr.ReadEntityBody(Buffer, Buffer.Length). Somehow when ReadEntitybody is called, it just hands for several seconds and returns 0. I tried to search for a solution to this problem, and I came to a thread that describes the same symptoms and tells that the solution is to turn off trace. I did turn off trace on web.config and page, but I still get the same result. I am pretty frustrated and I am hoping someone could offer me some clue on how to solve this. Has anyone implemented that solution with an httphandler? Best regards, CESAR While (ContentLength - TotalReceived) >= Received Buffer = New Byte(BUFFSIZE) {} Received = hwr.ReadEntityBody(Buffer, Buffer.Length) fs.Write(Buffer, 0, Received) TotalReceived += Received Context.Application("progress_1" + _progressID) = TotalReceived / ContentLength * 100 End While
    Saturday, July 31, 2004 9:56 PM

All replies

  • User619892963 posted
    I found the answer. Tracing has nothing to do with the delay and then 0 result of ReadEntityBody. I found that if you extract o call some content of the request object at ihttpmolude level, the entire request crashes. That this way the only information that one can obtain from HttpWorkerRequest after calling something from the request object (like params) is what HttpWorkerRequest has already preloaded from the request. So watch out for that you do to the request, when you are working at high up the http pipeline. Anyway, there is so little information about the behavior of this class, that I hope this helps someone avoid does long hours of debugging. CESAR LOO
    Wednesday, August 4, 2004 5:07 PM