I'm creating a program that ought to automatically populate a form on a web site with information, and then submit that form. I've done this kind of thing a lot before, but this time I'm running into an interesting problem -- the "input type=file" element.

With the "input type=file" element, a filename box is automatically created along with a Browse button. Clicking the filename box opens the file browser -- you can't type in the filename box manually.

For my program, however, I want to manually set the value of this filename box. Usually, I would just get the element from the page, then call: element.SetAttribute("value",myNewValue). However, with the "input type=file" element, that hasn't worked, presumably because the user cannot normally manually edit the value of the box (though I could be wrong about that being why).

I've tried one alternative: calling element.InvokeMember("setAttribute(''value',''" + myNewValue + "'')"). The MSDN documentation of the "input type=file" object suggested this might work, but I didn't get a result. (Source, for reference: http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx )

Any suggestions for how to accomplish this? Either a way to bypass the prevention of manually modifying the filename box, or a way to dynamically put my desired file into the file browser box that pops up?

I've asked this elsewhere once, and one reply was about how I shouldn't be attempting to write a server that will accomplish this anyway -- so let me make sure it's perfectly clear, I'm just writing a client program that ought to mimic what I would be doing anyway. Its purpose is that there's a particular site that I submit things to whose interface only supports one submission at a time, and I have several hundred things I need to submit.