图片上传借误码,请教
index.htm
========================================
<% response.buffer=true %>
<html><head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head><body>
<form method="POST" action="process.asp">
<p>请输入图片:<input type="file" name="pic" size="20">
<input type="submit" value="提交" name="B1">
<input type="reset" value="全部重写" name="B2"></p>
</form></body>
</html>
=================================================================
Process.asp
<%
response.buffer=true
Imagesize=Request.TotalBytes
ImageData=Request.BinaryRead(ImageSize)
BnCrLf=chrB(13)&chr(10)
Divider=LeftB(ImageData, Clng(InstrB(ImageData,BnCrLf))-1)
response.write(Clng(InstrB(ImageDate,BnCrLf))-1)
Dstart=InstrB(ImageData,BnCrLf&CrLf)+4
Dend=InstrB(Dstart+1,ImageData,Divider)-Dstart
MyData=MidB(ImageDate,Dstart,Dend)
Set imgConn=Server.CreateObject("Adodb.connection")
imgConn.open "Driver={Microsoft Access Driver (*.mdb)};DBQ="&Server.Mappath("img.mdb")
strConn="select * from img"
set rs=Server.CreateObject("Adodb.RecordSet")
rs.open strConn,imgConn,1,3
Rs.AddNew
rs("pic").AppendChunk MyData
Rs.Update
Rs.close
Imgconn.close
set rs=nothing
set imgconn=nothing
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<body>
</body>
</html>
错误情况:
Microsoft VBScript 编译器错误 错误 '800a03f6'
缺少 'End'
/iisHelp/common/500-100.asp,行242
Microsoft VBScript 运行时错误 错误 '800a0005'
无效的过程调用或参数: 'LeftB'
/UploadPic/process.asp,行6