万方数据
金杈越舾
COMPUTESOFHU_^NAN.
软件技术
2003年12月10日
第12期
圆
</tr>
<tr>
RFCl867标准开发的组件,如果使用其他文件上传
width=叩6”>
<tdclass=CC<div
组件,应当修改涉及对象obj的函数。news.asp的部分
源代码如-V:
<%
Set
align=”right”>作者:</div>
</td><tdclass=td2width=”564”><inputtype=”text”nmcue=”author"size="50”msxlen—mh="20”></td></tr>
<tr>
obj=Server.Cr
oateObject("file.Upload”)
board=obj.GetTheValue("board”)
tide=obj.GetTheValue("title”1author=obj.GetTheValue("author")contentB=obj.GetTheValRe("contents”)
strp=”FILEDSN=c:\
web\user.dsn”
<tdclass=ce<div
width=,『76”>
align=”right”>图片:</div>
class=td2width=,,564”>
SetdbLink=Server.CreateObject(”ADODB.Connection”)dbLink.mode=3
dbLink.Open
strp
</td><td
Setrs=Server.CreateObjeet("ADODB.Reeordset”)
1"8.10ektype=3rs.eursortype=1
<inputtype=filename=“image“size=“30“maxlength=“100”></td></tr>
<tr>
rs.open"SELECT‘FROMnews”,dbLink1"8.MoweLast
id=1"8.fields(”id”)class=CCwidth=叩6”>
id=id+1
<td
<div?align
‘,td><td
"tPright”>内容:</div>
image=obj.SaveAs(“image“,“image“&id&“.Jp91,Serv—
er.MapPath(”./pie/”))
rs.addnew
class=td2width=,,564”>
name="contentsHcols=1’0"rows=“15“></t—
<textareaextarea>
1"8.Fields(”tide”)=title1"8.Fields(”contents”)=contentsr8.Fields("auth”)=authorl"S.Fields(”board”)=board
</td></tr>
<tr>
r8.Fields(”imag"1=image
I"8.Updatem.closedbLink.close
<tdclass=tdleolspan=’,2”><div
align
2”center">
<input<input</div></td></tr>
type=”submit”name=”Submit”value=”提交”>
type=”reset"name=”Submit2”value=”清除”>
%>
,
四、图片的显示在需要显示图片的.asp文件中写入下面的代码:
<%
if
</form></table><div
align。”center"></div>
</body>
rs.6elds(”imas")<>”then
</html>
response.write(