
<!--#include file="../inc/conn.asp"-->
<!--#include file="Inc/Admin.Asp"-->
<!--#include file="Inc/Function.asp"-->
<html>
<head>
<title>文件上传</title>
<meta name="Description" content="">
<link rel="stylesheet" href="manage.css" type="text/css">
</head>
<body>
<%
'开发：www.aspprogram.cn
'作者：wangsdong
'原创文件，请保留此信息
'友情下载，脚本之家：http://www.jb51.net
fuptype=session("fuptype")'上传类型
fupname=session("fupname")'文件名
frmname=session("frmname")'form名
bdname=session("bdname")  '表单名
if fuptype="" or fupname="" or frmname="" then
response.write "<script language='javascript'>"
response.write "alert('出现错误，请重新上传！');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
%>
<!--#include FILE="upload_5xsoft.inc"-->
<%
set upload=new upload_5xsoft
set file=upload.file("file1")
if file.fileSize>0 then
filename=fupname+"."
filenameend=file.filename
filenameend=split(filenameend,".")
n=UBound(filenameend)
filename=filename&filenameend(n)
if fuptype<>"db" then
if file.fileSize>1572864 then
response.write "<script language='javascript'>"
response.write "alert('您上传的文件太大，上传不成功，单个文件最大不能超过1500K！');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
end if
if fuptype="adv" or fuptype="pic" then
if LCase(filenameend(n))<>"xls" then
response.write "<script language='javascript'>"
response.write "alert('不允许上传您选择的文件格式，请检查后重新上传！');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
end if
if fuptype="pic" then
savepath="upexcel/"&filename
end If

file.saveAs Server.mappath(savepath)
response.write "<script>opener.document."&frmname&"."&bdname&".value='"&Replace(savepath,"../","")&"';window.close();</script>"

%>
<%
else
response.write "<script language='javascript'>"
response.write "alert('文件内容不能为空，单击“确定”返回上一页！');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
end if
set upload=nothing
session("fuptype")=""
session("fupname")=""
session("frmname")=""
%>
</body> 
</html>
