trims30
asked on
How to Preset Value for Input Type=File
Am using IE8 or FireFox 18.0.2 and want to use ASP File Upload but am unable to programatically set value for Input Type=File. (xtfilename) in example below.
I'm using this to upload a program generated file. I can use Browse Button to select file and my program works but would like to preset file name in the input field rather than have user hunt for file.
Tried passing file name using POST as in the following example.
Also tried VB code to open the form in a webbrowser then using the browser document property to set value into xtfilename.
WebBrowser1.Document.file_ upload.xtf ilename.Va lue = "C:\SomeFileName"
No luck so far.
Could use some help on this.
Thanks,
Lee
I'm using this to upload a program generated file. I can use Browse Button to select file and my program works but would like to preset file name in the input field rather than have user hunt for file.
Tried passing file name using POST as in the following example.
<%
dim xtfilename
xtfilename=Request.QueryString("tFN")
%>
<form name="file_upload" method="POST" ENCTYPE="multipart/form-data" OnSubmit="return ProgressBar();" Action="<%=PostURL%>">
<Div ID=files>
<input type="File" name="File1" size="60" value="<%=xtfilename%>"><br>
<input type="hidden" name="email" size="60" value="<%=tMailto%>">
<br>
</Div>
<input Name=SubmitButton Value="Upload" Type=Submit><br>
</Form>
Also tried VB code to open the form in a webbrowser then using the browser document property to set value into xtfilename.
WebBrowser1.Document.file_
No luck so far.
Could use some help on this.
Thanks,
Lee
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Your options are limited. An ActiveX control can interact with the local PC's file system and Java Applets can. Other options exist as well but they generally require installing software on the user's PC.
ASKER
Scrapped it out and am writing FTP procedure .
Will Split points today
Thanks.
Lee
Will Split points today
Thanks.
Lee
ASKER
Prior to IE8 we were able to programatically PASTE into a File Type field but IE8 stopped that.
Trying to automate posting of c:\users\sam\appdata\local
Since IE8 I've put a message on the page telling them to click BROWSE and find file c:\users\sam\appdata\local
Any solutions you could recommend??
Lee