Last post Aug 24, 2011 01:29 PM by ojm37
Aug 23, 2011 12:48 PM|ojm37|LINK
Anyone know how I can get to some low-level debugging with
GetPreloadedEntityBody() to find out why, in some configuations it returns NULL even though the POST of data looks correct? I think what I need to do is to get to the raw post data and try to figure out what and where something is being changed
so that the GetPreloadedEntityBody() function does not recognize it as valid.
Aug 23, 2011 02:21 PM|ojm37|LINK
Anyone know how I can find out what the WorkerRequest is trying to read? When looking at other parameters of the WorkerRequest (such as content length), the values look correct. It's just GetPreloadedEntityBody (or even ReadEntityBody) that is returning
Aug 24, 2011 01:29 PM|ojm37|LINK
Never did find out how to read the low-level data. So, I ended up troubleshooting the issue brute force: cut out everything extraneous (the upload worked!), then start adding things back in in small chunks until it fails.
SO, if you have code that does upload and calls GetPreloadedEntityBody to read the uploaded data AND that code is in a User Control (ascx.vb or ascx.c) AND you attempt to read data from the form or query string like this:
strValue = httpRequest.Current.Request("QSValue").ToString()
THEN the GetPreloadedEntityBody will return zero bytes. The above code must do something with the request IO stream when it checks to see if the string value is in the form or the query string.
Changing the above code to this:
strValue = httpRequest.Current.Request.QueryString("QSValue").ToString()
FIXES THE PROBLEM!!