Jump to content

IE Browse Button Choose File to Upload


6pack
 Share

Recommended Posts

I have a script that opens IE then looks to upload a file to the webpage.  The code below is to click on the BROWSE button...This is successful.

Local $Btn = _IEGetObjByName($oIE, "file")
 _IEAction($Btn, "click")

Then when the CHOOSE FILE TO UPLOAD window opens the next part of my script fails.

WinActivate("[CLASS:#32770]", "")
WinFlash("[CLASS:#32770]", "", 4, 500)
ControlClick("[CLASS:#32770]", "", "Edit1")
Local $file = "\\NETWORK FILE NEEDING TO BE UPLOADED"
ControlSetText("[CLASS:#32770]", "", "Edit1", $file)
ControlClick("[CLASS:#32770]", "", "Button1")

Consequently, if I manually click CANCEL in the CHOOSE FILE TO UPLOAD Window then manually click BROWSE to reopen the CHOOSE FILE TO UPLOAD Window the next part of my script runs successfully adding the FILE to the CHOOSE FILE TO UPLOAD Window.  Is there something that I'm missing to have this run seamlessly?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...