upload.asp
ã <form action=http://<ï¼
= Request. ServerVariables(SERVER_NAME)>/wdread.asp method=post>
ã <p>主é¢: <input type=text name=subject><br>
     ä½è
:<input name=author type=text><br>
     åå¸æ¶é´: <input name=date1 type=text><br>
     ä¸è½½æ件:<input type=file name=filename>
     åå¾URL: <input type=hidden name=TargetURL value=http://<ï¼
= Request.ServerVariables(SERVER_NAME)ï¼
>/users/<ï¼
=Request.ServerVariables(LOGON_USER) ï¼
> size=20><br>
ãã<input type=submit value=ç¡®å®> </p>
ãã</form>
wdread.aspxml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” /??
<form enctype=multipart/formï¼data action=http://<ï¼
= Request.ServerVariables (SERVER_NAME) ï¼
>/scripts/cpshost.dll?PUBLISH?wdwriter.asp method=post name=form1>
ããä¸è½½æ件:<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=ç¡®å®>
ãã</form>
ãã<scripts language=VBScript>
‘ å¨ä¸è½½æ¶åºå¯¹è¡¨ååfilenameçå¼ä¸upload.aspç¨åºä¸çåå¼è¿è¡æ¯è¾, å 为å¨upload.aspä¸è¾å
¥çæ件åå¨æ¬ç¨åºä¸é¢ç½®ç»è¡¨ååfilename,ä¸æ¦å®¢æ·ç«¯éæ°è¾å
¥æ°çæ件ååæ交确认,ä¼ä½¿ç¨åºwdwriter.aspä¸åå
¥æ°æ®åºçæ件åä¸å®é
ä¸è½½çæ件åä¸ä¸æ ·, 导è´ç½é¡µè¿æ¥åºé.æ¤å¤è¿è¡å¤æ,å¦æ两è
ç¸ç,åç«å³ä¸è½½,å¦ååæ¶æä½.
ãã<!ï¼ï¼
sub upload_onclick()
set myform=window.document.form1
tmp=myform.filename.value
ã ããif strcomp(tmp,<ï¼ =session
 (filename)ï¼ >)=0 then
form1.submit
else
ãããã msgbox å¢,æ¨è¾å
¥çæ件åæ误,请éæ°è¾å
¥ï¼
end if
ãend sub
ããï¼ï¼>
ãã</scripts>
wdwriter.asp
<ï¼
Set mydata = Server.CreateObject (ADODB.Connection) mydata.Open DSN=xczh;UID=sa;PWD=;
‘ æå¼æ°æ®åº.
date1=session(date1)
 ‘ åå表ååçå¼.åæ¶é´.
subject=session(subject)
 ‘ åæ件主é¢.
author=session(subject)
‘ åä½è
.
filename=session(filename)
‘ åæ件å.
ããTargetURL= session(TargetURL)
‘ åæ件å¨æå¡å¨ä¸åæ¾çç©çå°å.
ããsqlstr=insert into wdlsb values( ï¼ sn ï¼ ,ï¼ subject ï¼ ‘, ï¼ date1 ï¼ ‘,ï¼filename ï¼ ‘, ï¼ TargetURL 1, ï¼ author ï¼ ‘)
‘ åæ°æ®åºå¹¶ä¿å.
ããMydata.Execute(sqlstr)
ããï¼
>
[1]