<!-- #include file="../common/checkru.asp" -->
<!-- #include file="../common/m_sub_inc.asp" -->
<!-- #include file="../common/commfun.asp" -->
<!-- #include file="../common/ip_purview.asp" -->
<% Server.ScriptTimeOut = 5000 %>
<html lang="zh-cn" style="background: none;">
<head>
<title>文件上传</title>
<%  
  Call htmlmeta() 
%>
<link rel="stylesheet" href="../style/css/<%= LingFengNet_MS_web_css %>.css" type="text/css">
<link rel="stylesheet" href="../style/css/m_common.css" type="text/css">
<link rel="shortcut icon" href="../pic/favicon.ico" type="image/x-icon">
<link rel="bookmark" href="../pic/favicon.ico" type="image/x-icon">
</head>
<body style="background: none;">
<!--#include file="uploadsoft.asp"-->
<%
IF LingFengNet_LFM_config_upload = "0" Then
	HtmEnd LingFengNet_MS_language_upload_1
End IF

Dim upload,savpath
savepath = "upload"
GuAutoName = 1
Call FolderNameCheck(savepath)
'IF right(savepath,1) <> "/" Then savepath = savepath&"/"

Set upload = new AnUpLoad
upload.Exe = LingFengNet_MS_add_upload_3
upload.MaxSize = LingFengNet_MS_add_upload_2 * 1024
upload.SingleSize = LingFengNet_MS_add_upload_2 * 1024
upload.GetData()
IF upload.ErrorID > 0 Then 
	HtmEnd upload.Description
Else
	Dim file
	Set file = upload.files("upfile")
	IF file.isfile Then
		Set fso = Server.CreateObject("Scripting.FileSystemObject")
		savepath = savepath &"/"& Year(now) & Right("0" & Month(Now), 2) & Right("0" & Day(Now), 2) &"/"
		IF Not fso.FolderExists(Server.MapPath(savepath)) Then
			fso.CreateFolder(Server.MapPath(savepath))
		End IF 
		IF GuAutoName = 1 Then
			result = file.saveToFile(savepath, 0, true)
		Else
			result = file.saveToFile(savepath, 1, true)
		End IF
		
		IF result Then
			Session("nameok") = Year(now) & Right("0" & Month(Now), 2) & Right("0" & Day(Now), 2) &"/"& file.filename
			IF Session("nameok") = "" Then Htmend LingFengNet_MS_language_upload_5
			HtmEnd "文件'" & file.LocalName & "'上传成功,文件大小" & file.size & "字节"
		Else
			HtmEnd LingFengNet_MS_language_upload_5 & file.Exception
		End IF
	Else
		HtmEnd LingFengNet_MS_language_upload_5
	End IF
End IF

Sub HtmEnd(Msg)
	Response.Write "<div class=""wdlf_liuYan_detail_item"" style=""margin:0""  ><div class=""wdlf_liuYan_detail_content"">&ensp;"& LingFengNet_MS_language_addnew_upload_1 &"</div><div class=""wdlf_liuYan_input""></div><input style=""width: 21%;top: 7px;"" type=button onclick=""javascript:history.back();"" class=""wdlf_liuYan_file_sub buttonface"" value="""&LingFengNet_MS_language_upload_7&""" /></div></div><script>alert("" "&Msg& " "")</script></body></html>"	
	Set upload = Nothing
	Response.End
End sub

Sub FolderNameCheck(FolderNameNew)
	Dim Letters,i,c
	Letters = "+=:;,[]<>\|*?"
	For i = 1 to Len(FolderNameNew)
		c = Mid(FolderNameNew, i, 1)
		IF InStr(Letters,c) <> 0 Then
			Htmend LingFengNet_MS_language_upload_6
		End IF
	Next
End Sub
%>
</body> 
</html>