File input

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
3 posts Page 1 of 1
Contributors
User avatar
gille
Member
Member
Posts: 33
Joined: Fri Nov 27, 2009 11:11 pm

File input
gille
Hello,

There is a webpage with a file input.
How can I put a file in the input with VB?

gille
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4392
Joined: Tue Aug 04, 2009 1:47 am

Re: File input
CodenStuff
Populate the file input box on a webpage with the location/filename you wish to upload?

Using a webbrowser control and knowing the file input element ID on the page you could do something like this:
Code: Select all
Dim Element As HtmlElementCollection = WebBrowser1.Document.All
        WebBrowser1.Document.GetElementById("FileInputElement").SetAttribute("value", "C:\MyFileToUpload.zip")
        
If you struggle with that code please post back with the webpage url which contains the file input box your trying to fill in and I will see if I can get you the code for it.

Hope that helps cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
gille
Member
Member
Posts: 33
Joined: Fri Nov 27, 2009 11:11 pm

Re: File input
gille
Thanks, but an input field hasn't a value-attribute.
I would like to upload a file on 2shared: http://www.2shared.com/
3 posts Page 1 of 1
Return to “Tutorial Requests”