6pack

IE Browse Button Choose File to Upload

2 posts in this topic

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?

Share this post


Link to post
Share on other sites



If the cancel button has a hotkey (ctrl + c) then you can add it to your script.


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
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