<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include FILE="upload.inc"--> 
<%
set upload=new upload_5xsoft
set file=upload.file("file1")
if file.fileSize>0 and file.filesize<300000 then
    '自动生成文件名
    filename=date()
    filename=filename&time()
    filename=replace(filename,"-","")
    filename=replace(filename,":","")
    filename=replace(filename," ","")
    filename=filename+"."
    filenameend=file.filename
    filenameend=split(filenameend,".")
    
  if filenameend(1)="gif" or filenameend(1)="jpg" or filenameend(1)="rar" or filenameend(1)="zip" then
        filename=filename&filenameend(1)
        file.saveAs Server.mappath("upload/"&filename)
       session("filename")=filename
    else
        response.write "文件格式不对"
        response.write "<a href=upload.asp>返回"
        response.end
    end if
    set file=nothing
else
    response.write "文件大小超过了限制"
    response.write "<a href=upload.asp>返回"
   
response.end
end if
set upload=nothing


response.write "<font size=2>图片上传成功,请复制图片路径以便备用</font>"
response.write "<script>parent.esung.body.value+='[upload="&filenameend(1)&"]"&filename&"[/upload]'</script>"
'rs的时候把filename写入数据库%>