| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 567 人关注过本帖
标题:关于上传组件求教
只看楼主 加入收藏
兰若云
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2004-12-6
收藏
 问题点数:0 回复次数:0 
关于上传组件求教

!--#include file="upload.inc"-->

<% dim formsize,formdata If request.querystring("biaoti") <> "" then Dim conn,sql,rs,connstr set conn=server.createobject("adodb.connection") conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("db1.mdb") set rs=server.createobject("adodb.recordset") sql="SELECT * From yuanchuang where (id is null)" rs.open sql,conn,1,3 rs.addnew rs("biaoti")=request.querystring("biaoti") If request.querystring("wenben") <> "" Then rs("wenben")=request.querystring("wenben") Else dim upload,file,formName,formPath,iCount,filename,fileExt set upload=new upload_5xSoft ''建立上传对象 formPath="pic" ''在目录后加(/) if right(formPath,1)<>"/" then formPath=formPath&"/" end if iCount=0 for each formName in upload.file ''列出所有上传了的文件''对象不是集合 set file=upload.file(formName) ''生成一个文件对象 ' if file.filesize<100 then 'response.write "<font size=2>请先选择你要上传的图片 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>" 'response.end 'end if 'if file.filesize>70000 then 'response.write "<font size=2>图片大小超过了限制 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>" 'response.end 'end if 'fileExt=lcase(right(file.filename,4)) ' if fileEXT<>".gif" and fileEXT<>".jpg" and fileEXT<>".swf" then ' response.write "<font size=2>文件格式不对 [ <a href=# onclick=history.go(-1)>重新上传</a> ]</font>" ' response.end 'end if filename=file.FileName savefile=formPath+filename if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据 file.SaveAs Server.mappath(savefile) ''保存文件 'response.write"图片路径:" 'response.write"<input type=text name=bannerpath value="& ulpath &"flash/"& formPath&File.FileName&">" 'response.write"&nbsp; 请记清你上传的图片路径" end if rs("wenjian")="& formPath&File.FileName&" set file=nothing iCount=iCount+1 next set upload=nothing ''删除此对象 End If rs.update rs.close set rs=nothing conn.close set conn=nothing

Else Response.write"标题不能为空" response.end End If Response.write"上传成功" %> 程序运行中断帮看看哪错拉

搜索更多相关主题的帖子: 组件 
2004-12-13 18:05
快速回复:关于上传组件求教
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014721 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved