Request 对象 错误 'ASP 0104 : 80004005'

lcp 2005-05-07 12:50:11
哪位大侠可以告诉我这是什么错误吗?
谢谢!
...全文
1178 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
wsdzmhongm 2005-05-07
  • 打赏
  • 举报
回复
帖出代码
  • 打赏
  • 举报
回复
楼上的200k问题和干部说的问题都有可能
qiqunet 2005-05-07
  • 打赏
  • 举报
回复




在MetaBase.xml文件中找“Max”就行了,有几个与“Max”相关的变量,根据自己的需要更改。






qiqunet 2005-05-07
  • 打赏
  • 举报
回复



如无意外,这与你的程序无关(我没看你的代码,看了头会晕)



IIS有文件传输上限,表单域也有数据量上限,如果是IIS6,可在“C:\WINDOWS\system32\inetsrv\MetaBase.xml”文件中更改,IIS5的话我不懂改。







lcp 2005-05-07
  • 打赏
  • 举报
回复

sub uploadfileclass() '上传文件子程序

dim lb,file,formName,formPath,iCount,ranNum,fileExt,FileName,rs,Extarry,outcode

lb=upload.Form("lb")


'iCount=0
'if upload.form("filepath")="" then ''得到上传目录
' HtmEnd "请输入要上传至的目录!"
' set upload=nothing
'response.end
'else
' formPath=upload.form("filepath")
''在目录后加(/)
'if right(formPath,1)<>"/" then formPath=formPath&"/"
'end if
'for each formName in upload.objForm ''列出所有form数据
' response.write formName&"="&upload.form(formName)&"<br>"
'next
'response.write "<br>"
'for each formName in upload.objFile ''列出所有上传了的文件

response.Write("<link href=""DEFAULT.css"" rel=""stylesheet"" type=""text/css""><body bgcolor=#FFFFFF text=#000000 topmargin=0 marginwidth=0 marginheight=0>")
set file=upload.file("file1") ''生成一个文件对象
if file.FileSize>4096000 then
response.Write("上传文件,超出大小!请重新上传.<a href=?lb="&lb&">返回</a>")
exit sub
end if
if file.FileSize>0 then

randomize
Extarry=split(file.FileName,".")
fileExt=Extarry(ubound(Extarry))
ranNum=int(90000*rnd)+10000
if CheckFileExt(fileExt)=false then
response.Write("文件类型不符.请注意上传规定的文件类型!<a href=?lb="&lb&">返回</a>")
exit sub
end if
if rsupfiles>=upfiles and lb<>"face" then
response.Write("你今天已经上传了 "&upfiles&" 个文件了,每天可以上传 "&upfiles&" 个文件")
exit sub
end if
' FileName=formPath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt
' response.write file.FilePath&file.FileName&" ("&file.FileSize&") => "&formPath&File.FileName&" 成功!<br>"
if lb="face" then '如果是上头像,以用户名为文件名,改变上传目录
FileName="upface/"&user&"."&fileExt '确定上传目录,上传文件名
outcode="头像上传结束! [<a href=?lb="&lb&">返回</a>]<script>parent.document.form1.myface.value='"&filename&"'</script>"
else
FileName="upimg/"&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt '确定上传目录,上传文件名
outcode=" 1个文件上传结束! [<a href=?lb="&lb&">返回</a>]<script>parent.document.FORM1.ly.value+='[IMG]" &filename& "[/IMG]'</script>"
end if
file.SaveAs Server.MapPath(FileName)
else
response.Write("请选择要上传的文件.<a href=?lb="&lb&">返回</a>")
exit sub
end if
'看是否有上传头像 如果有-更新数据,如否添加记录
if lb="face" and (not conn.execute("select user from upfile where user='"&user&"' and lb='face'").eof) then
conn.execute("update upfile set [user]='"&user&"',[pic]='"&FileName&"',[time]=now(),[size]='"&file.FileSize&"',[lb]='"&lb&"',[F_type]='"&fileExt&"' where user='"&user&"' and lb='face'")
else
conn.execute("insert into upfile([user],[pic],[time],[size],[lb],[F_type]) values ('"&user&"','"&FileName&"',now(),'"&file.FileSize&"','"&lb&"','"&fileExt&"')")
end if
response.write(outcode)
set file=nothing
set upload=nothing ''删除此对象
end sub

if upload.Form("Submit")<>"" then
call uploadfileclass()
else
set upload=nothing
%>
<html>
<head>
<title>文件上传</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="DEFAULT.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" topmargin="0" marginwidth="0" marginheight="0">
<%
if rsupfiles>=upfiles and request.QueryString("lb")<>"face" then
response.Write("你今天已经上传了 "&upfiles&" 个文件了,每天最多上传 "&upfiles&" 个文件")
else
%>
<form name="form1" method="post" action="upfilex.asp" enctype="multipart/form-data" >
<table width="542" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="206">
<input type="file" name="file1" value=""></td>
<td width="336">
<input type="submit" name="Submit" value="提交">
<input type="hidden" name="upcount" value="1">
<input name="lb" type="hidden" id="lb" value="<%=request.QueryString("lb")%>">
你还可上传:<b><%=upfiles-rsupfiles%></b>个文件 每天<b><%=upfiles%></b>文件 每个4M</td>
</tr>
</table>
</form>
<%end if%>
</body>
</html>
<%end if%>
lcp 2005-05-07
  • 打赏
  • 举报
回复
<!--#include file="CONN.ASP" -->
<%

Server.ScriptTimeOut=500000

dim Data_5xsoft

Class upload_5xsoft

dim objForm,objFile,Version

Public function Form(strForm)
strForm=lcase(strForm)
if not objForm.exists(strForm) then
Form=""
else
Form=objForm(strForm)
end if
end function

Public function File(strFile)
strFile=lcase(strFile)
if not objFile.exists(strFile) then
set File=new FileInfo
else
set File=objFile(strFile)
end if
end function


Private Sub Class_Initialize
dim RequestData,sStart,vbCrlf,sInfo,iInfoStart,iInfoEnd,tStream,iStart,theFile
dim iFileSize,sFilePath,sFileType,sFormValue,sFileName
dim iFindStart,iFindEnd
dim iFormStart,iFormEnd,sFormName
Version="化境HTTP上传程序 Version 2.0"
set objForm=Server.CreateObject("Scripting.Dictionary")
set objFile=Server.CreateObject("Scripting.Dictionary")
if Request.TotalBytes<1 then Exit Sub
set tStream = Server.CreateObject("adodb.stream")
set Data_5xsoft = Server.CreateObject("adodb.stream")
Data_5xsoft.Type = 1
Data_5xsoft.Mode =3
Data_5xsoft.Open
Data_5xsoft.Write Request.BinaryRead(Request.TotalBytes)
Data_5xsoft.Position=0
RequestData =Data_5xsoft.Read

iFormStart = 1
iFormEnd = LenB(RequestData)
vbCrlf = chrB(13) & chrB(10)
sStart = MidB(RequestData,1, InStrB(iFormStart,RequestData,vbCrlf)-1)
iStart = LenB (sStart)
iFormStart=iFormStart+iStart+1
while (iFormStart + 10) < iFormEnd
iInfoEnd = InStrB(iFormStart,RequestData,vbCrlf & vbCrlf)+3
tStream.Type = 1
tStream.Mode =3
tStream.Open
Data_5xsoft.Position = iFormStart
Data_5xsoft.CopyTo tStream,iInfoEnd-iFormStart
tStream.Position = 0
tStream.Type = 2
tStream.Charset ="gb2312"
sInfo = tStream.ReadText
tStream.Close
'取得表单项目名称
iFormStart = InStrB(iInfoEnd,RequestData,sStart)
iFindStart = InStr(22,sInfo,"name=""",1)+6
iFindEnd = InStr(iFindStart,sInfo,"""",1)
sFormName = lcase(Mid (sinfo,iFindStart,iFindEnd-iFindStart))
'如果是文件
if InStr (45,sInfo,"filename=""",1) > 0 then
set theFile=new FileInfo
'取得文件名
iFindStart = InStr(iFindEnd,sInfo,"filename=""",1)+10
iFindEnd = InStr(iFindStart,sInfo,"""",1)
sFileName = Mid (sinfo,iFindStart,iFindEnd-iFindStart)
theFile.FileName=getFileName(sFileName)
theFile.FilePath=getFilePath(sFileName)
'取得文件类型
iFindStart = InStr(iFindEnd,sInfo,"Content-Type: ",1)+14
iFindEnd = InStr(iFindStart,sInfo,vbCr)
theFile.FileType =Mid (sinfo,iFindStart,iFindEnd-iFindStart)
theFile.FileStart =iInfoEnd
theFile.FileSize = iFormStart -iInfoEnd -3
theFile.FormName=sFormName
if not objFile.Exists(sFormName) then
objFile.add sFormName,theFile
end if
else
'如果是表单项目
tStream.Type =1
tStream.Mode =3
tStream.Open
Data_5xsoft.Position = iInfoEnd
Data_5xsoft.CopyTo tStream,iFormStart-iInfoEnd-3
tStream.Position = 0
tStream.Type = 2
tStream.Charset ="gb2312"
sFormValue = tStream.ReadText
tStream.Close
if objForm.Exists(sFormName) then
objForm(sFormName)=objForm(sFormName)&", "&sFormValue
else
objForm.Add sFormName,sFormValue
end if
end if
iFormStart=iFormStart+iStart+1
wend
RequestData=""
set tStream =nothing
End Sub

Private Sub Class_Terminate
if Request.TotalBytes>0 then
objForm.RemoveAll
objFile.RemoveAll
set objForm=nothing
set objFile=nothing
Data_5xsoft.Close
set Data_5xsoft =nothing
end if
End Sub


Private function GetFilePath(FullPath)
If FullPath <> "" Then
GetFilePath = left(FullPath,InStrRev(FullPath, "\"))
Else
GetFilePath = ""
End If
End function

Private function GetFileName(FullPath)
If FullPath <> "" Then
GetFileName = mid(FullPath,InStrRev(FullPath, "\")+1)
Else
GetFileName = ""
End If
End function
End Class

Class FileInfo
dim FormName,FileName,FilePath,FileSize,FileType,FileStart
Private Sub Class_Initialize
FileName = ""
FilePath = ""
FileSize = 0
FileStart= 0
FormName = ""
FileType = ""
End Sub

Public function SaveAs(FullPath)
dim dr,ErrorChar,i
SaveAs=true
if trim(fullpath)="" or FileStart=0 or FileName="" or right(fullpath,1)="/" then exit function
set dr=CreateObject("Adodb.Stream")
dr.Mode=3
dr.Type=1
dr.Open
Data_5xsoft.position=FileStart
Data_5xsoft.copyto dr,FileSize
dr.SaveToFile FullPath,2
dr.Close
set dr=nothing
SaveAs=false
end function
End Class

'判断文件类型是否合格
Private Function CheckFileExt (fileEXT)
dim Forumupload,i
Forumupload="gif,jpg,bmp,jpeg,png,txt,rar,zip,doc,pdf"
Forumupload=split(Forumupload,",")
for i=0 to ubound(Forumupload)
if lcase(fileEXT)=lcase(trim(Forumupload(i))) then
CheckFileExt=true
exit Function
else
CheckFileExt=false
end if
next
End Function


dim rs,sql,upload,user,upfiles,rsupfiles

set upload=new upload_5xsoft ''建立上传对象

user=request.cookies("renwen")("user")

upfiles=8

if user="" or request.cookies("renwen")("passedok")<>"ofdkjduy" then
response.Write("此页面为注册用户页,请注册!")
response.End()
end if

set rs=server.createobject("adodb.recordset")
sql="select time from upfile where datediff('d',time,Now())<1 and lb<>'face' order by id desc"
rs.open sql,conn,1,1

rsupfiles=rs.recordcount
lcp 2005-05-07
  • 打赏
  • 举报
回复
大侠,好像不对啊!
我是上传文件时碰到这个问题.
原来程序限制文件大小400k
我把它改成4M,可是仍然是400K以下可以,超过400K会碰到刚才的错误.
dsclub 2005-05-07
  • 打赏
  • 举报
回复
Access数据库是只读的。

对Access数据库文件进行Select操作没问题,但是Insert Delete Update都不能成功执行,被系统报告“数据库或对象为只读”。
这样的情况先看数据库文件的属性是不是只读的,如果是把它修改过来!如果不是只读的,那么这种情况属于NTFS分区的权限问题,给Access文件Everyone完全控制就可以了。先在 文件夹选项->查看->去掉“使用简单文件共享”。这样保证了可以在看到安全标签选项!然后右键点Access文件->属性->安全->添加EveryOne->勾选完全控制。
再通过Web程序对Access数据库文件进行更新的相关操作,就OK了。
当然,还要注意在对Access数据库文件进行操作时一定保证不能被其它进程独占!

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧