|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
VB and HTML buttons
Hello all, first time poster...was hoping someone could help me out.....basically I've been writing this VB program that will automatically log into a website and download/upload files. I've got the download part to work, but the upload is where I seem to be having a problem...I'm at the point where I can fill in the form with the path to the file I want to upload(i.e. "c:\test.txt") but what I want to do is automatically select the "Upload File" button(there's not going to be any user intervention to carry this out, there in lies the problem)...anyway, I've come to the conclusion that the web page isn't set up correctly...let me know what you think...
There's a button set up like this: <input VALUE="Upload File" TYPE=SUBMIT> which doesn't have a Name="blah" associated with it....on a different site I was able to instantiate the button using the buttons name...any idea's how to activate this button(without user intervention) and without using the Name? |
|
#2
|
|||
|
|||
|
If you are using JavaScript, you can loop through all the objects in the forum until the value = "Upload File".
for (i=0 ; i < document.forms[0].length; i++) To automatically submit a form <BODY onLoad="FormName.submit();"> Probably that will be easier... |
|
#3
|
|||
|
|||
|
Hmmm..that's an interesting idea, and I am looking into using it. But I'm not sure it's going to work...I'm trying to do a "Post" from a VB6 program, and as far as I can tell, I need to reference that button...(also, the page doesn't have a specfic line stating the form name...who ever designed this page needs to work out some issues...but that's another story
![]() |
|
#4
|
|||
|
|||
|
Can you change to a FTP solution for uploading? It may be easier to implement.
There are security restrictions on file uploads via http that generally prevent you from programmatically selecting and uploading files without user intervention.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#5
|
|||
|
|||
|
I wish I could use FTP...it would make my life easier, but unfortunatly, I can't...
|
|
#6
|
|||
|
|||
|
Autosubmit help
You have access to all the elements of a form by the order they appear in the html document.
For Example HTML CODE: <Form> <input type="text"> <input type="submit" value="Submit"> </Form> VB6 Code: m_oEXP.Document.Forms(0).element(0).Value = "c:\myfile.text" m_oExp.Document.Forms(0).element(1).click or m_oEXP.Document.Forms(0).element(0).Value = "c:\myfile.text" m_oExp.Document.Forms(0).submit Hope this helps...-Jamie |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > VB and HTML buttons |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
![]() |
|