文件上传的问题
飞天鼠 2006-04-29 10:50:24 大家好,小弟刚刚学写文件上传的程序,在网上看了一些资料,写了个简单的,如下:
<%
filePath = request.form("file")
fileName = binaryToString(filePath)
fileName = getFileName(fileName)
set objStream = server.createobject("adodb.stream")
objStream.type = 2
objStream.mode = 3
objStream.open
objStream.LoadFromFile filePath
objStream.saveToFile server.mappath(fileName),1
objStream.close
set objStream = nothing
function getFileName(filePath)
getFileName = Mid(filePath,InStrRev(filePath,"\")+1)
end function
%>
运行时出现以下提示:
ADODB.Stream (0x800A0BB9)
参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。
指示的错误是这句:objStream.LoadFromFile filePath
请问应该如何解决,为什么?
谢谢!