Aman Ghai

Aman Ghai

  • NA
  • 21
  • 40.4k

How to set value for input file type & auto-upload selected file

Apr 5 2012 12:01 PM
I have a windows form with a webbrowser control in it. I navigate to a web page & there are many text-controls, combobox - I am able to set value for all of them. There is also an input-file control to select a file from local computer & an Upload submit-button to upload the selected file.

I am not able to set the value for file-control. I have tried SendKeys.Sendwait, but that just doesn't work, even when the webbrowser control has the focus.

Can you please help me on this  issue? I need to resolve this urgently. I need the code to select the file automatically by code & then upload it.

Thanks, Amandeep

Answers (3)