Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to fill a file upload HTML textbox from VFP
Message
 
 
To
07/05/2004 08:53:20
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00901893
Message ID:
00901924
Views:
43
Juliano,

It's pretty easy to automate a form in IE:
oIE = createobject( "internetexplorer.application" )
oIE.Visible = .t.
oIE.Navigate( "www.google.com" )
do while oie.Busy()
   doevents
enddo
loDoc = oIE.Document && get the Document object
loForm = loDoc.forms(0) && get the first form object
loForm.Item(3).Value = "foxpro" && this is the field for the search string
loform.Submit() && submit the form

you can use code like to find the items of a form:
* explore the form items
     
for i = 0 to loForm.Length-1
   ? i, loForm.Item(i).Name, loForm.Item(i).Value
endfor

You can also access the items by their names:
loItem = loForm.item( "q" )
loItem.value = "this is so cool"

If you have VFP8 or VFP7 this stuff becomes really trivial because of Intellisense. You can just kind of explore things from the command window. You can also lookup IE DocumentObjectModel (DOM) on MSDN to help direct your explorations.

>How can I fill a "file upload" textbox of a HTML form from VFP?
>
>I know how to manipulate other type of HTML control, but the (input type="file" name="File1") I didn't find a way to fill it yet...
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform