Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Internet Explorer COM object
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Internet Explorer COM object
Miscellaneous
Thread ID:
00817045
Message ID:
00817045
Views:
62
I am using Visual FoxPro (v7.0) to create an Internet Explorer COM object and navigate to a site for which I must enter a file name. I have FoxPro enter the name of the file into a text box (actually there are 10 text boxes; I enter the name of the file into the first box). However, each time I submit the form I get a message that says "Please enter a file or file(s) to upload." In trying to find out why this message appears, I coded the following:

oIE.Document.ValidForm.my_file(0).Value="C:\THISISATEST"

WAIT WINDOW "NNN"+oIE.Document.ValidForm.my_file(0).Value+"NNN"

There is no other code between these two statements. The resulting WAIT WINDOW shows:
NNNNNN. Therefore, I know that the value ("C:\THISISATEST") FoxPro entered did not actually get put in the box. I have used all 10 subscripts to the array my_file and still get the above WAIT WINDOW text.

Does anyone have an idea about why the value "C:\THISISATEST" is not being set in the box?

I get no FoxPro error messages when I run the program that contains the above code. I have included below the HTML code (between Pre tags) for the page I navigate to.

Thank you for your help!!
Brent
<body bgcolor=White>
<body text=Black>
<body link=Blue>
<body alink=Red>
<body vlink=Purple>
<body background=background1.gif>
<html><head><title>Zions Management Services Company - Upload Files</title></head>
<body><center><h1><img src="zionsbank.bmp" align=left align=top vspace=0 border=0>
Zions Management Services Company welcomes swm1505</h1><h2>Upload your files 
here</h2></center><br Clear=Left><hr>Files will be copied to:  
<B>HTTPS://mailbox.zionsbank.com/WebUploads/swm1505/</B><br><hr><br><center>
<form enctype="multipart/form-data"NAME=ValidForm action=
"HTTPS://mailbox.zionsbank.com/webmailbox/cpshost.dll?PUBLISH?" method=post 
onSubmit="return(Button1_OnClick(this))"><I>Select your local files to upload</I>
<br>File to process: <input name="my_file" type="file" size="50"><br>File to process:
 <input name="my_file" type="file" size="50"><br>File to process: <input name=
"my_file" type="file" size="50"><br>File to process: <input name="my_file" type=
"file" size="50"><br>File to process: <input name="my_file" type="file" size="50">
<br>File to process: <input name="my_file" type="file" size="50"><br>File to process:
 <input name="my_file" type="file" size="50"><br>File to process: <input name=
"my_file" type="file" size="50"><br>File to process: <input name="my_file" type=
"file" size="50"><br>File to process: <input name="my_file" type="file" size="50">
<br><br><I>Then press button to</I> <input type="submit" value="Upload Now">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>or to </i> 
<INPUT TYPE="reset" VALUE="Clear Form"><br><i>You will need to use the "Back" 
button on your browser to return here</i><input type=hidden name="TargetURL" 
value="HTTPS://mailbox.zionsbank.com/WebUploads/swm1505/"></form></center><form>
</form><br><hr><form action="HTTPS://mailbox.zionsbank.com/webmailbox
/DownloadFiles.asp" method=get><input type=submit value="Download Page"><i>
(to see files available for downloading)</i></form><form action="HTTPS:
//mailbox.zionsbank.com/webmailbox/Support.asp" method=get><input type=submit 
value="Support Page"><i>(for contact information for system support)</i></form>
<form action="HTTPS://mailbox.zionsbank.com/webmailbox/WebMailbox_Help.asp" 
TARGET="Help Window" method=get><input type=submit value="Help Page"><i>(for help 
on how to use the system)</i></form><form action="https://mailbox.zionsbank.com/
webmailbox/" method=get><input type=submit value="Home Page"><i>(Back to home page)
</i></form><hr><a href="http://www.momsys.com"><img src="momsys5.gif" width=91 
height=40 vspace=0 border=0 align=absbottom alt="Go to MomSys.com"></a> Designed by
 <b>Momentum Systems</b>&nbsp&#169 copyright 2000<br><a href="http:
//www.momsys.com"><img src="connecting_moving.gif" width=200 height=60 vspace=0 
border=0 align=abstop alt="Go to MomSys.com"></a></body></html>
	<SCRIPT LANGUAGE="JavaScript">
	<!--
	function Button1_OnClick(TheForm){
		var i;
		var result;
		result = 0;

			for (i = 0; i < 10; i++){
				if (TheForm.my_file[i].value.length > 0) {
					result = 1;
				}
			}
		
		if (result == 0) {
			
				alert("Please enter a file (or files) to upload.");
			
		}
		else{
			if (!CheckForDups(TheForm)) {
				return true;
			}
		}
		return false;

	}
	function CheckForDups(TheForm){
		var i;
		var j;
		var file1;
		var file2;
		  for (i = 0; i < 9; i++){
		   for (j = i +1; j < 10; j++){
		    if ((TheForm.my_file[i].value.length > 0) && (TheForm.my_file[j].value.length > 0)){
		      file1 = TheForm.my_file[i].value;
			if (file1.lastIndexOf("\\")){
			  file1 = file1.substr(file1.lastIndexOf("\\")+1)
						}
			else if (file1.lastIndexOf("/")){
			  file1 = file1.substr(file1.lastIndexOf("/")+1)
						}
			  file2 = TheForm.my_file[j].value;
			    if (file2.lastIndexOf("\\")){
			      file2 = file2.substr(file2.lastIndexOf("\\")+1)
						}
				else if (file2.lastIndexOf("/")){
				  file2 = file2.substr(file2.lastIndexOf("/")+1)
						}
				    if (file1.toUpperCase() == file2.toUpperCase()){
				      alert ("Duplicate files found, " + (i+1) + 
                                      " and " + (j+1) + " (" + file1 + ")\nPlease
                                       remove one");
			return true;
						}
					}
				}
			}
		
		return false;
	}
	// -->
	</SCRIPT>
Brent L. Hackett
Next
Reply
Map
View

Click here to load this message in the networking platform