Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Upload Button Automation

Posted on 2000-02-25
5
Medium Priority
?
558 Views
Last Modified: 2012-06-27
Hi all, i need your expert advice here.

I am using an upload component from www.aspupload.com. Using this component, i have a pre-select files to uplaod, i want to automate UPLOAD button. I wrote code for that, at onLoad event of <body>. It's not working. Pls take a look, and help me in fidning out the problem.

thanx in advance!
-FirAlian

<script language="VBScript">
Sub Select_OnClick
      UploadCtl.Select
End Sub
Sub Remove_OnClick
      UploadCtl.RemoveHighlighted
End Sub
Sub RemoveAll_OnClick
      UploadCtl.RemoveAll
End Sub
Sub Upload_OnClick
      UploadCtl.Upload
End Sub
</script>

<html>

<head>
<meta HTTP-EQUIV="REFRESH" CONTENT="20;t.asp">
<title></title>
</head>

<body onload="JavaScript:setTimeout('MyForm.submit()',5000)">
<p>
<object WIDTH="500" HEIGHT="200" ID="UploadCtl"
CLASSID="CLSID:E87F6C8E-16C0-11D3-BEF7-009027438003" CODEBASE="XUpload.ocx">
  <param name="EnablePopupMenu" value="False">
  <param name="ViewServerReply" value="False">
  <param name="frmUpload" value="MyForm">
  <param name="Server" value="rntv">
  <param name="Script" value="/v2/xupload/samples/uploadscript.asp">
  <param name="FILE1" value="d:\nemos_pure">
</object>
</p>

<form name="MyForm" method="POST">
  <p><input TYPE="BUTTON" NAME="SELECT" VALUE="Select"> <input TYPE="BUTTON" NAME="REMOVE"
  VALUE="Remove"> <input TYPE="BUTTON" NAME="REMOVEALL" VALUE="Remove All"> <input
  TYPE="button" NAME="UPLOAD" VALUE="Upload"> </p>
</form>
</body>
</html>
0
Comment
Question by:FirAlian
  • 3
  • 2
5 Comments
 

Expert Comment

by:ColmaN
ID: 2558796
try with
<script>
<!--
function execute()
{
    MyForm.submit()
    // or
    // Document.Myform.submit()
    // or
    // Document.forms[0].submit()
}
//-->
</script>
<body onload="a=setTimeout('execute()',5000)">

an onload option is javascript defect you dont need put it, and maybe you need to assign to a variable the timeout.

i don´t undestand the problem.. i read the source and i think that you want to wait 5 seconds before you force a submit , if is this you dont need to put the timeout in the onload.. you could put it at buttom with

<script>
<!--
function execute()
{
    document.myform.submit()
     //or
     //document.forms[0].submit()
}
a=setTimeot('execute()',5000);
//-->
</script>

normaly work better if you call a function that an inline..
0
 

Author Comment

by:FirAlian
ID: 2558870
Thanx for your suggestion.
Actually, i want this page to keep executing at 5 minutes interval, when a user logs in, and will run untill user clicks LOGOUT (i will add this button later).

I tried your sugesstion # 2, IE error window pop up, with msg "Wrong number of arguments or invalid property assignment: 'execute'".

Any more suggestions...???

I really apprecite your help, and concern. I hope you gonna make this code run for me.

Do you think I need to refresh the page. using <meta...> as well, or delay time in setTimeout will be enough?

-FirAlian
0
 

Author Comment

by:FirAlian
ID: 2558975
I think following code is better to consider as Upload Button is just used as type 'BUTTON' and an onClick event is written in VBScript. We need to automate that Onclick VBScript event.

Can we do it? as i tried this code and it works if i click upload button by my self.

<script language="VBScript">
Sub Select_OnClick
      UploadCtl.Select
End Sub
Sub Remove_OnClick
      UploadCtl.RemoveHighlighted
End Sub
Sub RemoveAll_OnClick
      UploadCtl.RemoveAll
End Sub
Sub Upload_OnClick
      UploadCtl.Upload
End Sub
</script>

<html>

<head>
<title></title>
</head>

<body>

<p>
<object WIDTH="500" HEIGHT="200" ID="UploadCtl"
CLASSID="CLSID:E87F6C8E-16C0-11D3-BEF7-009027438003" CODEBASE="XUpload.ocx">
  <param name="EnablePopupMenu" value="False">
  <param name="ViewServerReply" value="False">
  <param name="Server" value="rntv">
  <param name="Script" value="/v2/xupload/samples/uploadscript.asp">
  <param name="FILE1" value="d:\nemos_pure">
</object>
</p>
 <p><input TYPE="BUTTON" NAME="SELECT" VALUE="Select"> <input TYPE="BUTTON" NAME="REMOVE"
  VALUE="Remove"> <input TYPE="BUTTON" NAME="REMOVEALL" VALUE="Remove All"> <input
  TYPE="button" NAME="UPLOAD" VALUE="Upload"> </p>
</body>
</html>
0
 

Accepted Solution

by:
ColmaN earned 40 total points
ID: 2564358
sorry, is

a=setTimeot('execute',5000);

not

a=setTimeot('execute()',5000);


and yes use your code, just put more. .append the code i write.

the set timeout is enought

regards
0
 

Author Comment

by:FirAlian
ID: 2565724
Thanx ColmaN, I did it, and working great. :))
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question