<!--#include file="../inc/Secure.htm"-->
<head>
<title>上传附件</title>
</head>
<%
LoginID=trim(session("LoginID"))
if LoginID="" then LoginID=0
if request("cmdDelete")<>"" then
	DeleteOneFile "../File_Up/DocTemp/"& LoginID &"/" &trim(Session("DocAttachFile"))
	Session("DocAttachFile")=""
end if

if Session("DocAttachFile")="" then
%>
	<form name="form1" enctype="multipart/form-data" action="AddFile.htm" method="post">
	<input type="file" name="AttachFile" size=30>
	<input type="Submit" name="cmdUp" value="提 交" onclick="return CheckData();">
	</form>
<%else%>
	<form name="form2" action="AddFileForm.htm" method="post">
	现有附件：<%=Session("DocAttachFile")%>	
	<input type="Submit" name="cmdDelete" value="删  除" onclick="delfile();">
	</form>
<%end if%>

<script language=javascript>
function CheckData()
{
	if(jtrim(document.form1.AttachFile.value)=="")
	{
		alert("请选择上传图片。")
		document.RoomForm.AttachFile.focus();
		return false;
	}
			
	return true;
}
function delfile(){
	self.opener.document.MailForm.attachfile.value='';
}
</script>
<script language=javascript src="../inc/jtrim.js"></script>
<%
sub DeleteOneFile (FilePathName)
	FilePathName=Server.Mappath(FilePathName)
	dim fs
	Set fs = server.CreateObject("Scripting.FileSystemObject")
	if trim(FilePathName)<>"" and fs.FileExists(FilePathName) then 
		fs.DeleteFile FilePathName
	end if
	set fs=nothing	
end sub
%>
