Question

This page acts as a good example for my problem :

http://valums.com/files/2009/ajax-upload/demo-jquery.htm

If you click on the browse button and select a file, the file will be uploaded ajax-style (without posting the whole webpage).

I am developing a C# WinForm application where a WebBrowser control allows me to parse and fill forms automatically and I need to upload a file without opening the "File Browse" window which steals focus away from other windows.

How can this be achieved ?

Was it helpful?

Solution

Since you have one specific page you want to automatically populate it's going to be a lot easier to recreate the POST message that is generated using either the WebClient or a HttpWebRequest.

A good code example can be found here and a good tool (one of many though) to see the data that gets posted is fiddler2

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top