【求助】那位高手帮忙解决ASP无控件上传问题急急急急解决
小弟没办法找出请客位出请各位高手帮心,急!!!!!!
错误原因!!!
ADODB.Stream 错误 '800a0bba'
文件无法被打开。
/tp/upload.asp,行 19
upload.asp
<%
'定义变量strFileName用来获取返回名,formPath用来获取本来的路径
dim strFileName,formPath
formPath="database/"
Function GetFileName(ByVal strFile)
If strFile <> "" Then
GetFileName = mid(strFile,InStrRev(strFile,"\")+1)
Else
GetFileName = ""
End If
End function
strFileName=request("file1")
'用于保存现在所上传图片的路径
session("address")=formPath&GetFileName(strFileName)
Set objStream = Server.Create
Object("ADODB.Stream")
objStream.Type = 1 ' adTypeBinary
objStream.Open
objStream.LoadFromFile strFileName
objStream.SaveToFile Server.MapPath(formPath&GetFileName(strFileName)),2
objStream.Close
%>
<%=session("address")%>显示上传路径
upload.htm
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<form name="FORM" action="upload.asp" method="post">
<input type="submit" name="submit" value="OK">
<input type="file" name="file1" style="width:400" value="">
</form>
</body>
</html>