设为首页   加入最爱           最新更新:全方位英文文章资料库
 
资料坊搜索: 标题 全文     
w3 upload组件实例应用
   首页>>YesizeCOM>>电脑技能坊>>ASP>>正文       
 
广告招租,e-mail:yesize@hotmail.com

广告招租,e-mail:yesize@hotmail.com


文件1 - Upload.asp
<html>
<head>
<title> w3 Upload </title>
</head>
<body>
用w3 upload组件上传
<form action=UploadProcess.asp method=post enctype=multipart/form-data>
<input type=file name=thefile><br>
Choose a name: <input type=text name=name><br>
<input type=submit value=Transmit>
</form>
</body>
</html>

文件2 - UploadProcess.asp
<% @ LANGUAGE=VBSCRIPT %>
<%
Set upload = Server.CreateObject( w3.upload )

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>

你的邮箱 <br>
<input type=text size= 25 name= email><br>< /FONT>

收信者名字 <br>
<input type= text size= 25 name= recipient><br>< /FONT>

标题 <br>
<select name=subject size=1>
<option value=help>help
<option value=tips>tips
<option value=other>other
</select>
<br>

内容 <br>
<textarea name=body cols=40 rows=15 wrap=PHYSICAL></textarea>
<br>

附件 <br>
<input type=file name=attachment>
<br>
<br>
<input type=submit value= Submit >
</form>
</b></font>
</body>
</html>


文件2 - JmailUploadProcess.asp

<%
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)

输入你的SMTP-server
JMail.ServerAddress = xxx.zzz.yyy

JMail.Sender = Senderemail
JMail.Subject = Subject

JMail.AddRecipient Recipient

JMail.Body = Body

JMail.Priority = 3

JMail.Execute

%>
<html>

<head>
<title>Dimac</title>
</head>

<body>
<br>
<br>
<p align=center><font face=Arial, geneva size=5>
邮件发送 </font></p>
<center>
<font face=Arial, geneva size=3>
你的邮件被发送到<%= Recipient %> <br>
<br>
<br>
<br>

</font>

</center>
</body>
</html>


上一篇:Microsoft SQL Server 全文索引服务 下一篇:W3 Jmail 使用范例

版权说明:作品来源于网上,版权归作者所有,如果无意中侵犯了您的版权,请来信告知,本站将在3个工作日内删除。yesize@hotmail.com
  热门小游戏分类 
射击小游戏 连连看小游戏
台球小游戏 成人小游戏
CS小游戏 化妆小游戏
赛车小游戏 休闲小游戏
篮球小游戏 换装小游戏
儿童小游戏 牛牛小游戏
麻将小游戏 冒险小游戏
美媚小游戏 益智小游戏
体育小游戏  
Society Recreation & Sports
Travel & Leisure Communications
Vehicles Computers
Fashion Arts & Entertainment
Reference & Education Disease & Illness
Writing & Speaking Politics
Product Reviews Food & Beverage
Finance Internet Business
Self Improvement Home & Family
Health & Fitness Business
最新更新内容
警惕“公务员报考热”背
公务员考试不是丈母娘考
一名新公务员的自白:我
公务员考脑筋急转弯与挂
北努斗:2006行政能力测
大讨论:06行测BT题目大
过来人回忆:当年,我也
一家之言:公务员热折射
公务员考试申论要是有正
数十万大学生走进公务员
      粤ICP备05005424         Copyright ©2000 - 2004 Yesize.COM