Upload. asp
<Form action = http: // <%= Request. ServerVariables (SERVER_NAME)>/wdread. asp method = post>
<P>Topic: <Input type = text name = subject> <br>
Author: <Input name = author type = text> <br>
Release Date: <Input name = date1 type = text> <br>
Upload files: <Input type = file name = filename>
SentURL: <input type = hidden name = TargetURL value = http: // <%= Request. ServerVariables (SERVER_NAME)%>/Users/<%= Request. ServerVariables (LOGON_USER)%> Size = 20> <br>
<Input type = submit value =OK> </P>
</Form>
Wdread. asp
<Form enctype = multipart/form-Data action = http: // <%= Request. ServerVariables (SERVER_NAME)%>/Scripts/cpshost. dll? PUBLISH? Wdwriter. asp method = post name = form1>
Upload files: <Input type = file name = filename value = <%= Session (filename)%>
<Input type = hidden name = TargetURL value = http: // <%= Request. ServerVariables (SERVER_NAME)%>/Users/wdls>
<Input type = button name = upload value =OK>
</Form>
<Scripts language = VBScript>
'Form fields should be uploadedFilenameAndUpload. aspCompare the domain values in the program,Because inUpload. aspThe file name entered in this program is preset to the form fieldFilename,Once the client re-enters the new file name, submit it for confirmation.,Make the programWdwriter. aspThe name of the file written to the database is different from the actual uploaded file name.,Webpage connection Error.Judge here,If the two are equal,Upload now,Otherwise, cancel the operation..
<!--
Sub upload_onclick ()
Set myformdomainmetadata Doc ument. form1
Tmp = myform. filename. value
If strcomp (tmp, <%= Session
(Filename)%>) = 0 then
Form1.submit
Else
MsgboxOh,The file name you entered is incorrect.,Enter again!
End if
End sub
-->
</Scripts>
Wdwriter. asp
<%
Set mydata = Server. CreateObject (ADODB. Connection) mydata. Open DSN = xczh; UID = sa; PWD =;
'Open Database.
Date1 = session (date1)
'Returns the value of each form field..Time taken.
Subject = session (subject)
'Retrieve file topic.
Author = session (subject)
'Author.
Filename = session (filename)
'Get File Name.
TargetURL = session (TargetURL)
'Obtain the physical address of the file stored in the server.
Sqlstr = insert into wdlsb values (&Sn&,&Subject&',&Date1&',&Filename&',&TargetURL&',&Author&')
'Write database and save.
Mydata. Execute (sqlstr)
%>
[1]