I am building a Windows application that hosts an ASP.NET application using the MS Web Browser Control. (see http://www.west-wind.com/presentatio...netruntime.asp for a similar app). I run into problems if one of my ASP.NET pages needs to upload a file (via HTTP). I am using the BeforeNavigate2 event of the Web Browser Control to find the target URL that the browser is trying to navigate to, process the page using the .NET runtime, and then redirect the browser to the processed page.
The problem however is whenever the postData should include file data. The postData buffer (a System.Byte array) only includes the data up to the point where the actual file contents should be. An example, trying to upload a text file
[start of postData buffer
-----------------------------7d43d2a4301a
Content-Disposition: form-data; name="__VIEWSTATE
dDwzMzE1NzE4ODE7Oz5UBPSkAU4QqiCLuPn0GKSUITDjpA=
-----------------------------7d43d2a4301a
Content-Disposition: form-data; name="MyFile"; filename="C:\Documents and Settings\schellhase\Desktop\hello.txt
Content-Type: text/plai
[end of postData buffer
The postData contains no more data: not the file, not the boundary string for the file and not any other fields following the file upload in the form. My question is: why does the postData buffer stop here and how can I get the rest of this data? (I realize since this is local I can just use the filename to read the file locally, but I'd rather not do this - this also means I'd lose any fields in the form that come after the file
Thanks