|
-
April 2nd, 2001, 09:02 PM
#1
Fill Input File Type box on a web page
I am trying to automate filling a form on the Web.
I have a file type input box and how can I put values on that Text box? I was able to put values into common text boxes other than type "File".
Anybody has any ideas???
Here is a sample htm file which has a file input box.
Test.htm
--------
<p align=left>Enter name of TEXT file:<input id="file1" name="txtFile" type="file" ></p>
</p>
-
April 3rd, 2001, 10:23 AM
#2
Re: Fill Input File Type box on a web page
This cannot be done because the file type text box is client side and you have no control of the value. I tried for fun using this to test it. you can set smelly input box but not the file one.
<body>
<form name="filer">
<p align="left"> Enter name of TEXT file:<input id="file1" name="txtFile" type="file"></p>
<P>Yoshi <input id="txtoknow" name="smelly"></P>
</form>
</body>
<script Langauge=javascript>
window.onload = document.forms[0].smelly.value = "C:\\test.txt"
</script>
-
June 1st, 2001, 02:32 PM
#3
Re: Fill Input File Type box on a web page
Did you ever find a solution to this problem?
I am also trying to pre-fill a form (on the client side). I can use the DOM to get input elements and set their value (xx.value = "abc"). This works for input type = text, and input type=password. However, it does not work for input type=file.
Any clues?
-
June 1st, 2001, 03:09 PM
#4
Re: Fill Input File Type box on a web page
Yes, I did.
I had to use a third party control to do this.
The control CSINet is available at
http://web.singnet.com.sg/~kegoh/CSInet.htm.
Try it out..
Here is an example of code.
CSControl1.URL = "http://localhost/abc.htm"
CSControl1.clearfile
CSControl1.Addfile "txtfile", "C:\a.txt"
CSControl1.abort
strRes = CSControl1.Upload
Makesure that URL property for the CSInet should be the page which you are trying to post.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|