急,ASP图片上传问题
本地测试中doc|xls|ppt和JPG上传都是正常都,但放到服务器上后只有doc|xls|ppt上传正常,JPG大小在50K左右以上时就超时了,而其他文件几M也正常,这是为什么啊?贴上代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="admin_upload.INC"-->
<html>
<head>
<title>文件上传</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<p>
<%
dim upload,f_folder,file,formPath,iCount,filename,fileExt,filesizemin,filesizemax
filesizemin=100
filesizemax=500000*1024
set upload=new upload_5xSoft '建立上传对象
f_folder=upload.form("upfilefolder")
d_time=upload.form("d_time")
d_zz=upload.form("d_zz")
d_bt=upload.form("d_bt")
d_sm=upload.form("d_sm")
'********************************列出所有上传文件***************************************************
For each formName in upload.objFile
set file=upload.file(formName)
If file.filesize>0 then
'********************************检测文件大小***************************************************
If file.filesize<filesizemin Then
response.write "你上传的文件太小了 [ <a href=# onclick=history.go(-1)>重新上传</a> ]"
ElseIf file.filesize>filesizemax then
response.write "文件大小超过了 "&filesizemax&"字节 限制 [ <a href=# onclick=history.go(-1)>重新上传</a> ]"
End If
'********************************检测文件类型****************************************************
fileExt=ucase(right(file.filename,4))
uploadsuc=false
Forum_upload="RAR|ZIP|SWF|JPG|PNG|GIF|DOC|TXT|CHM|PDF|ACE|MP3|WMA|WMV|MIDI|AVI|RM|RA|RMVB|MOV|XLS"
Forumupload=split(Forum_upload,"|")
for i=0 to ubound(Forumupload)
if fileEXT="."&trim(Forumupload(i)) then
uploadsuc=true
exit for
else
uploadsuc=false
end if
next
if uploadsuc=false then
response.write "文件格式不正确 [ <a href=# onclick=history.go(-1)>重新上传</a> ]"
response.end
end if
'********************************建立文件上传的目录文件夹****************************************
Set upf=Server.CreateObject("Scripting.FileSystemObject")
If Err<>0 Then
Err.Clear
response.write("您的服务器不支持FSO")
response.end
End If
If upf.FolderExists(Server.MapPath("../"&f_folder))=False Then
upf.CreateFolder Server.MapPath("../"&f_folder)
End If
f_ftn="../"&f_folder
Set upf=Nothing
'********************************保存上传文件至文件夹*****************************************
randomize
ranNum=int(900*rnd)+100
filename=f_ftn&"/"&day(now)&"_"&ranNum&"_"&file.filename
if file.filesize>filesizemin and file.filesize<filesizemax then
file.SaveAs Server.mappath(filename)
dim conn1
set conn1=CreateObject("ADODB.Connection")
conn1.Open "PROVIDER=SQLOLEDB;DATA SOURCE=(local);UID=sa;PWD=111;DATABASE=website"
sql = "insert into xiazai_biao(d_bt,d_lj,d_sm,d_time,d_zz) values('"&d_bt&"','"&filename&"','"&d_sm&"','"&d_time&"','"&d_zz&"')"
conn1.execute(sql)
conn1.close
set conn = nothing
iCount=iCount+1
end if
set file=nothing
end if
next
set upload=nothing '删除此对象
response.write ("文件上传成功! <a href=# onclick=history.go(-1)>继续上传</a>")
%>
</p>
</body>
</html>
<script type="text/javascript" ></script>