Automate select file dialog - Webbrowser

Kuranyi

Junior Member
Joined
Dec 21, 2009
Messages
109
Reaction score
58
Hello,
I want to automate a website with the webbrowser control(.net) where I have to upload a file. This is the input element where I want to add the path:
Code:
<input class="file" id="file" name="file" type="file" />

SetAttribute or InnerText don't work. I read that this is because of security reasons. After Invoke("click") the default "select file" dialog open. And that stops the whole tool.
And now I have no idea how to automate this. Of course I can run an other tool which send keys, but that is very bad and awkward. Besides i want to run my tool at the background.

So do you have an idea? I have already searched a lot..
Thanks, I will add rep for the solution. :)
Greetings!

PS: Yes, because of javascriopt I need to use the webbrowser control and not httprequest.
 
Many many thanks, bro! The first one is what I was looking for! After hours of working I got a great result.
Thanks! :)
 
Hey no problem! I know how it feels like to be stuck in one small thing which just doesn't work! ;)
 
Back
Top