Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to fill a file upload HTML textbox from VFP
Message
From
07/05/2004 10:49:22
 
 
To
07/05/2004 09:53:01
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00901893
Message ID:
00901928
Views:
31
Hi Juliano,

To help you in the right directions, I will post a part, sightly modified, of a code I have written to do a similar task:
lnTid=1200
lnOffset=0
oX=CreateObject("InternetExplorer.Application")
oX.visible=.T.
lcStart='http://www.yourwebsiteaswo.com' && change to your URL
oX.navigate(lcStart)
wait 'navigates!' window nowait
IF !NavComplete(oX,lnTid)
  ??chr(7)
  wait 'Timeout error!' window
  oX.visible=.f.
  release oX
  oX=null
  RETURN 
ENDIF
wait clear

loForm=oX.Document.forms(0)
loForm.item(2).value='yourvalue' && you may have to change item(2)
loForm.searchType(0).checked=.t. && Radiobutton 1
loForm.submit
wait 'navigates!' window nowait
IF !NavComplete(oX,lnTid)
  ??chr(7)
  wait 'Timeout error!' window
  oX.visible=.f.
  release oX
  oX=null
  RETURN
ENDIF
wait clear

FUNCTION NavComplete
  LPARA toIE, tnTimeout
  lnTimeout=IIF( TYPE("tnTimeout")="N",tnTimeout ,60 )
  lnTimeElapsed=0
  lnStartSeconds=SECONDS()
  DO WHILE .T.
    IF toIE.ReadyState=4
      DO WHILE .T.
        IF toIE.Document.ReadyState="complete"
          RETURN .T.
        ENDIF
        IF (SECONDS()-lnStartSeconds)>lnTimeout
          RETURN .F.
        ENDIF
      ENDDO
    ENDIF
    IF (SECONDS()-lnStartSeconds)>lnTimeout
      RETURN .F.
    ENDIF
  ENDDO
ENDFUNC
>Tks Wayne, but I must fill the value programmaticaly from VFP code... I'm using an IE object to fill the HTML from and submit it, but I don't know how to fill this file type textbox.
Previous
Reply
Map
View

Click here to load this message in the networking platform