Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Upload Button Automation

Posted on 2000-02-25
5
Medium Priority
?
554 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

719 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