请兄弟们帮忙看一段代码
这是上传图片的代码,我下载的一个网站系统的,后台总是无法上传图片,请请兄弟们帮忙看一下,在此谢过了!<!--#include file="conn.asp"-->
<!--#include file="user.asp"-->
<!--#include FILE="upload.inc"-->
<html>
<head><title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
-->
</style></head>
<body bgcolor="#FFFFFF">
<%
nowtime=now()
sj=cstr(year(nowtime))+"-"+right("0"+cstr(month(nowtime)),2)+"-"+right("0"+cstr(day(nowtime)),2)
dim upload,file,formName,formPath,iCount,pic
set upload=new upload_f '建立上传对象
'--------将日期转化成文件名--------
function MakedownName()
dim fname
fname = now()
fname = replace(fname,"-","")
fname = replace(fname," ","")
fname = replace(fname,":",""
)
fname = replace(fname,"PM","")
fname = replace(fname,"AM","")
fname = replace(fname,"上午","")
fname = replace(fname,"下午","")
fname = int(fname) + int((10-1+1)*Rnd + 1)
MakedownName=fname
end function
formPath="../pic/"
iCount=0
for each formName in upload.file ''列出所有上传了的文件
set file=upload.file(formName) ''生成一个文件对象
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
newname=MakedownName()&"."&mid(file.FileName,InStrRev(file.FileName, ".")+1)
'======加在这里
extname=mid(file.FileName,InStrRev(file.FileName, ".")+1)
extname=LCase(extname)
if extname="jpg" or extname="gif" then
file.SaveAs Server.mappath(formPath&newname) ''保存文件
end if
'======
iCount=iCount+1
end if
next
response.write "上传成功"
%>
<script language="JavaScript">
parent.myform.pic.value='<%=newname%>';
</script>
<%
set file=nothing
set upload=nothing ''删除此对象
%>
</body>
</html>