Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX and the infamous form file field

Status
Not open for further replies.

Ravage2099

Programmer
Aug 10, 2001
1
0
0
US
Hello all

I am trying to alter a script for my company that will allow our users to upload their files to us via our website, but not require their input to do so. As many of you I'm sure know, depending on user input can be a disastrous thing. We already have the process in place where the users have to manually hit Browse, search for the file, select it, and then hit "send". But that's not good enough.

I'm writing a client-side ActiveX component, that the users will have to agree to obviously, which searches an ini file on their system for a datapath (these users use our software, so we already have a slight understanding of their system) and then points directly to a file. The control then uses the SendKeys() function to write that value to the file field on the web form... but that is as far as I have been able to go.

Even with the field visibly filled out, a javascript call to the value of the field returns 0, and calling a submit() causes the field to wipe itself of what was previously written in the field. The entire process does work flawlessly using standard text fields though.

If anyone has input that may help me do this, or can suggest a non-FTP solution that may otherwise automate this process considering we are willing to use client-side ActiveX, please let me know. Thanks in advance
 
I may not fully understand the problem you are solving, but here is my exprerience working with ActiveX controls in the browser. Just before the form is submitted, you need to move the data from the ActiveX control into a hidden field. Here is an example:

<html>
<head>
<title></title>
</head>
<body>
<form action=&quot;default.asp&quot; method=&quot;post&quot; onsubmit=&quot;document.getElementById('data1').value = document.getElementById('object1').value;&quot;>
<object classid=&quot;clsid:abc...&quot; id=&quot;object1&quot; width=&quot;1&quot; height=&quot;1&quot;>
<param name=&quot;Value&quot; value=&quot;&quot; />
</object>

<input type=&quot;hidden&quot; name=&quot;data1&quot; id=&quot;data1&quot; value=&quot;&quot; />

<input type=&quot;submit&quot; id=&quot;button1&quot; name=&quot;button1&quot; value=&quot;Submit&quot; />
</form>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top