最后20分求段简单代码,关于上传的!!急用!!
我使用无惧无组件上传,现在有一个页面
<!-------sc.asp------>
============================================================
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<title> 无标题文档 </title>
</head>
<body>
<form method= "post " action= "tijiao.asp " name= "form1 ">
照片名称: <input type= "text " /> <br />
路径: <input type= "file " /> <br />
<input type= "submit " value= "提交 " />
</form>
</body>
</html>
=================================================
access数据库表img列名name,lj,帮我便一个 tijiao.asp的代码,要求把文件名存入列name中,把路径存入lj中,使用的是无惧无组件上传,使其他的上传类也行,只要能成功上传就给分,conn不用编写了,谢谢各位!!
------解决方案-------------------- <%
Response.Buffer = True
Server.ScriptTimeOut=9999999
On Error Resume Next
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<meta http-equiv= "Content-Language " content= "zh-cn " />
<meta content= "all " name= "robots " />
<meta name= "author " content= "木目,Woodeye " />
<meta name= "description " content= "木目ASP文件上传工具 " />
<meta name= "keywords " content= "木目,ASP,Upload,文件上传 " />
<style type= "text/css ">
<!--
body,input {font-size:12px;}
-->
</style>
<title> 木目ASP文件上传工具 </title>
</head>
<body id= "body ">
<%
ExtName = "jpg,gif,png,txt,rar,zip,doc " '允许扩展名
SavePath = "upload " '保存路径
If Right(SavePath,1) <> "/ " Then SavePath=SavePath& "/ " '在目录后加(/)
CheckAndCreateFolder(SavePath)
UpLoadAll_a = Request.TotalBytes '取得客户端全部内容
If(UpLoadAll_a> 0) Then
Set UploadStream_c = Server.CreateObject( "ADODB.Stream ")
UploadStream_c.Type = 1
UploadStream_c.Open
UploadStream_c.Write Request.BinaryRead(UpLoadAll_a)
UploadStream_c.Position = 0
FormDataAll_d = UploadStream_c.Read
CrLf_e = chrB(13)&chrB(10)
FormStart_f = InStrB(FormDataAll_d,CrLf_e)
FormEnd_g = InStrB(FormStart_f+1,FormDataAll_d,CrLf_e)
Set FormStream_h = Server.Createobject( "ADODB.Stream ")
FormStream_h.Type = 1
FormStream_h.Open
UploadStream_c.Position = FormStart_f + 1
'---------------------------------------------------------------
UploadStream_c.CopyTo FormStream_h,FormEnd_g-FormStart_f-3
'---------------------------------------------------------------
FormStream_h.Position = 0
FormStream_h.Type = 2
FormStream_h.CharSet = "GB2312 "
FormStreamText_i = FormStream_h.Readtext
FormStream_h.Close
FileName_j = Mid(FormStreamText_i,InstrRev(FormStreamText_i, "\ ")+1,FormEnd_g)