Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

how to set file path value in browse button input box

$
0
0

hi all,

 

i tried to set the value in file path to browse button input box.but its not working.pls any one help me

 

 

my code,

 

While 1     
   Switch GUIGetMsg()         
       Case $Btn             
           $sPath = FileOpenDialog("Open a file", @desktopdir, "All file (*.*)") ;~       
           If $sPath Then GUICtrlSetData($EXCEL, FileGetShortName($sPath))             
           If $sPath Then GUICtrlSetData($EXCEL, $sPath)                     
    case  $Button1
                    $EXCEL1=GUICtrlRead($EXCEL)
                    ;$IP1=GUICtrlRead($IP)
                Global $sCellValue6 =""
;MsgBox(0, "Example", "Window is minimized")
Global $oIE=_IECreate($sCellValue6)
Sleep(1000)
Send("{F4}")
Sleep(2000)


Send("http://192.168.1.1/index.asp")
Send("{ENTER}")
sleep(1000)
Global $state=WinWait("Windows Security", "",4)
if BitAND($state,8)Then
   ControlSend("Windows Security", "", "Edit1", "admin")
   ControlSend("Windows Security", "", "Edit1", "{TAB}")
   Sleep(500)
   ControlSend("Windows Security", "", "Edit2","admin")
   ControlSend("Windows Security", "", "Edit2","{TAB}")
   Sleep(500)
   ControlSend("Windows Security", "", "DirectUIHWND1","{TAB}")
   ControlSend("Windows Security", "", "OK","{ENTER}")
  EndIf
   
   Sleep(10000)
   
   Global $oIE=_IECreate("http://192.168.1.1/Upgrade.asp")
   Global $file= _IEGetObjByName($oIE,"file")
   _IEFormElementSetValue($file,$EXCEL1)
   
   sleep(1000)
   
   also the browse button java script code
 
    <TR><script>draw_table(SUBFUN,"")</script>
        <TD colspan=2 class=FUNNAME1> <script>Capture(fwupgrade.upgradefile)</script>:     <INPUT type=file name=file size="26" ></TD></TR>
        <TR><script>draw_table(SUBFUN,"")</script>

    pls any body replay me

 

 

 


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>