this is the upload form-----------
<%@ Language=VBScript %>
<%
option explicit
Response.Expires = -1
Server.ScriptTimeout = 600
%>
<!-- #include file="freeaspupload.asp" -->
<%
Dim uploadsDirVar
uploadsDirVar = "C:\Inetpub\wwwroot\candidate\up"
function OutputForm()
%>
<form name="frmSend" method="POST" enctype="multipart/form-data" action="uploadTester.asp" >
<B>File names:</B><br>
File: <input name="attach1" type="file" size=35 id="att1"><br>
<br>
<input style="margin-top:4" type=submit value="Upload">
<br><br>
</form>
<%
end function
function SaveFiles
Dim Upload, fileName, fileSize, ks, i, fileKey,item
Set Upload = New FreeASPUpload
Upload.Save(uploadsDirVar)
' If something fails inside the script, but the exception is handled
If Err.Number<>0 then Exit function
SaveFiles = ""
ks = Upload.UploadedFiles.keys
if (UBound(ks) <> -1) then
SaveFiles = "<B>Files uploaded:</B> "
for each fileKey in Upload.UploadedFiles.keys
SaveFiles = SaveFiles & Upload.UploadedFiles(fileKey).FileName & " (" & Upload.UploadedFiles(fileKey).Length & "B) "
item= Upload.UploadedFiles(fileKey).FileName
%><INPUT type="hidden" value="<%=item%>" name="attach"><%
next
end if
end function
%>
<HTML>
<HEAD>
</HEAD>
<BODY>
<br><br>
<%
outputform()
Response.Write savefiles()
%>
<script language=javascript>
function ToUpload(item){
var frm ;
frm = document.frmSend ;
frm.action="addCandidate.asp";
frm.submit();
}
</script>
<input type=submit value="OK" onclick="ToUpload();">
<br><br>
</BODY>
</HTML>
so when the user click button ok, he'll be direct to the addCandidate.asp page
<HTML>
<HEAD>
</head>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<BODY>
<form name="addCandidate" method="post" action="AddRecord.asp">
<tr>
<td><input class="text field" name="fullName"></td>
</tr>
<tr>
<td><input class="textField" name="Address"></td>
</tr>
<tr>
<td><input class="textField" name="attachment" ></td>
</tr>
<tr>
<td align="middle">
<input type="submit" value="Add" id=submit1 name=submit1>
</td>
</tr>
</form>
</BODY>
</HTML>
the attachment field is where i want to request the file name from the uploadpage.
I've use <input class="textField" name="attachment" value="<%=request.form("attach")%>"> in the attachment field and error message Cannot use Request.Form collection after calling BinaryRead. shown..
i also use
value="<%=UploadFormRequest("attach")%>" but type mismatch
actually im not good in asp..
still crawling~~really hope u can help me..