<!--#include file="../../conn/conn_other.asp"-->
<!--#include file="../check.asp"-->
<!--#include file="../../film/Incs/syscode.asp"-->
<!--#include file="../../inc/sql.asp"-->
<%
	end if
	useflag=1
%>
<!--#include file="../flag.asp"-->
<link href="css/Admin_Style.Css" rel="stylesheet">
<link href='../Include/Admin_Style.CSS' rel='stylesheet' type='text/css'>
<script language="javascript" src="js/Admin_Js.js"></script>
<%
Dim Action
Action=Request("Action")
If Action="UpLoad" Then
	Dim FileUP
	Set FileUP=New Upload_File
	Dim F_File,F_Type
	Set F_File=FileUP.File("File")
	F_Name=FormatTime(Now(),6)&RandNumber(1,1000)&"."&F_File.FileExt
	F_Type=Lcase(Trim(F_File.FileExt))
	
	If CheckFileExt(F_File.FileExt,UpAllowExt)=False Then
		RwEnd "<div style=""padding:6px""><a href='Admin_UpFile.asp'>您上传了不允许上传的文件类型，请返回重新上传</a></div>"
	End If
	
	If F_File.FileSize<1 Then
		RwEnd "<div style=""padding:6px""><a href='Admin_UpFile.asp'>您还没有选择文件，请返回重新上传</a></div>"
	End If
	
	If F_File.FileSize > 1024000 Then
		RwEnd "<div style=""padding:6px""><a href='Admin_UpFile.asp'>文件大小超出，请返回重新上传</a></div>"
	End If
	
	Dim Fso,SaveDir
	SaveDir=UpLoadDir&Year(Now())&"/"&Month(Now())&"/"
	Set Fso=New DmFso
		Call Fso.CreateFolder(SaveDir)
	Set Fso=Nothing
	
	F_File.SaveAs Server.MapPath(SaveDir&F_Name)
	
	Dim ResultPic
	ResultPic=Replace(SaveDir&F_Name,"../","")

	Rw "<script>parent.document.addnew.VideoPic.value='"&ResultPic&"';</script>"
	Rw "<div style=""padding:6px""><a href='Admin_UpFile.asp'>文件上传成功，请返回继续上传</a></div>"
	
	Set F_File=Nothing
	Set FileUP=Nothing

Else
%>
<div style="margin:0 0 0 10px;">
<form name="frm" enctype="multipart/form-data" method="post" action="Admin_UpFile.asp?Action=UpLoad">
<input name="File" type="File" size="20" class="text">&nbsp;
<input type="Submit" name="Submit" value="上传" class="button">
</form>
</div>
<%
End If
%>

