actualName = upload.Form( "name" ) Set fileName = upload.Form( "thefile" ) if fileName.IsFile then fileName.SaveToFile( Request.ServerVariables( "APPL_PHYSICAL_PATH" ) & "\" & actualName ) end if %> <html> <head> <title> w3 Upload </title> </head> <body> <br> <br> <center> Finished! </center> <br> <br> <br> </body> </html>
文件1 - JmailUpload.asp 这个例子展示了在用户上传文件给SERVER时如何带JMAIL的附件 <html> <head> <title>emailform</title> </head> <body> <font face="verdana, arial" size="2"><b> <form method="post" action="JmailUploadProcess.asp" ENCTYPE="multipart/form-data"> Complete this form and click the submit-button. We will answer your questions as soon as possible. <br><br> 你的名字 <br> <input type="text" size="25" name="name"><br>
<% Set upload = Server.CreateObject( "w3.Upload" ) Set JMail = Server.CreateObject("JMail.SMTPMail")< /FONT >
'检查附件并加入到email中 set attachment = upload.Form( "attachment" ) if attachment.IsFile then JMail.AddCustomAttachment attachment.filename, attachment.item end if
'得到form变量,使用upload组件 Name = upload.Form("name") SenderEmail = upload.Form("email") Subject = "Regarding " & upload.Form("subject") Recipient = upload.Form("recipient") Body = upload.Form("body")