<!--#include file="../conn.asp"-->
<!--#include file="../inc/function.asp"-->
<!--#include file="../inc/config.asp"-->
<!--#include file="../../include/config.Inc"-->
<!-- #include File="class_upfile.asp" -->
<!--
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 up_news.asp
'* 最后更新 2011-05-14 by 56770.kingdge
'*****************************************
--->
<html>
<head>
<link href="../css.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<BODY TEXT="#000000" MARGINHEIGHT="0" MARGINWIDTH="0" TOPMARGIN="0" LEFTMARGIN="0" bgcolor=#E8F1FF>
<%
response.charset="UTF-8"
session.codepage="65001"
Dim id:id = request("id")
include "../lang/"& LangFilePath &"/lang_sys.inc"
if request.cookies(cookiesname)("admin_name")="" then
	response.write "<table width=100% border=0 cellspacing=1 cellpadding=2 bgcolor=#E8F1FF><tr><td height=20>"& Lang_sys(78) &"</td></tr></table>"
else
        Select Case request("action")
               Case "ok" : Upfile_Main()
               Case else
	       main()
        End Select
End if
Sub Main()
	Dim PostRanNum
	Randomize
	PostRanNum = Int(900*rnd)+1000
	Session("UploadCode") = Cstr(PostRanNum)
%>
	<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#E8F1FF">
     <form name="form" method="post" action="?" enctype="multipart/form-data">
      <tr><td height="25">
	   <INPUT TYPE="hidden" NAME="UploadCode" value="<%=PostRanNum%>">
	   <input type="file" name="uploadfile" size="15" class="form"> 
	   <input type="submit" name="Ok" value="<%=Lang_sys(52)%>" class="button">
	   <input type="hidden" name="action" value="ok">
	 </td>
	 </tr>
	</form>
    </table>
<%
End Sub
Sub Upfile_Main()
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#E8F1FF">
<tr><td height="25">
<%
'Set Upload_56770 = New UpFile_Cls
'response.write
UploadFile()
%>
</td></tr>
</table>
</body>
</html>
<%
End Sub
Sub UploadFile()
	Server.ScriptTimeOut=9999999
'	'-----------------------------------------------------------------------------
	Dim Upload,FilePath,FormName,File,F_FileName,F_Viewname
	dim DrawInfo
	upfiletype="gif,jpg,jpeg"
	onesize="204800" '20KB
	FilePath = "../../pic/down/"
	FilePath=CreatePath(FilePath)
	DrawInfo = ""
	Set Upload_56770 = New UpFile_Cls
		Upload_56770.UploadType		= Upload_type			'设置上传组件类型
		Upload_56770.UploadPath		= FilePath								'设置上传路径
		Upload_56770.MaxSize			= Int(onesize)							'单位 KB
		Upload_56770.InceptMaxFile		= 1										'每次上传文件个数上限
		Upload_56770.InceptFileType		= upfiletype							'设置上传文件限制
		Upload_56770.RName			    = Upload_RName                          '文件名前缀
		Upload_56770.UploadSaveType		= Upload_SaveType
		Upload_56770.ChkSessionName		= "UploadCode"
		Upload_56770.PreviewType			= 999
		Upload_56770.PreviewImageWidth	= pic_xw										'设置预览图片宽度
		Upload_56770.PreviewImageHeight	= pic_xh										'设置预览图片高度
		Upload_56770.DrawImageWidth		= Upload_DrawWidth						'设置水印图片或文字区域宽度
		Upload_56770.DrawImageHeight		= Upload_DrawHight						'设置水印图片或文字区域高度
		Upload_56770.DrawGraph		= Upload_DrawGraph						'设置水印透明度
		Upload_56770.DrawFontColor		= Upload_Drawcolor						'设置水印文字颜色
		Upload_56770.DrawFontFamily		= Upload_Drawfont						'设置水印文字字体格式
		Upload_56770.DrawFontSize		= Upload_Drawfontsize						'设置水印文字字体大小
		Upload_56770.DrawFontBold		= Upload_DrawFontBold						'设置水印文字是否粗体
		Upload_56770.DrawInfo			= DrawInfo					'设置水印文字信息或图片信息
		Upload_56770.DrawType			= 0						'0=不加载水印 ，1=加载水印文字，2=加载水印图片
		Upload_56770.DrawXYType		= Upload_DrawXYType						'"0" =左上，"1"=左下,"2"=居中,"3"=右上,"4"=右下
		Upload_56770.DrawSizeType		= 1						'"0"=固定缩小，"1"=等比例缩小
		If Upload_Drawpiccolor<>"" or Upload_Drawpiccolor<>"0" Then
			Upload_56770.TransitionColor	= Upload_Drawpiccolor			'透明度颜色设置
		End If
		'执行上传
		Upload_56770.SaveUpFile
		If Upload_56770.ErrCodes<>0 Then
			Write_56770_Eshop("ERROR："& Upload_56770.Description & "[ <a href='javascript:history.back()'>"& Lang_sys(79) &"</a> ]")
			Exit Sub
		End If
		If Upload_56770.Count > 0 Then
			For Each FormName In Upload_56770.UploadFiles
				Set File = Upload_56770.UploadFiles(FormName)
				F_FileName = FilePath & File.FileName
				Write_56770_Eshop("<script>parent.download.l_downurl.value='"& Eshop_url & Replace(FilePath,"../","") & file.filename&"'</script>")
				Write_56770_Eshop("<a href='javascript:history.back()'>"& Lang_sys(79) &"</a>")
				Set File = Nothing
			Next
		Else
			Write_56770_Eshop(Lang_sys(80) &"[ <a href='javascript:history.back()'>"& Lang_sys(79) &"</a> ]")
			Exit Sub
		End If
	Set Upload_56770 = Nothing
End Sub
'检查上传目录，若无目录则自动建立
Function CreatePath(PathValue)
	On Error Resume Next
	Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
		If objFSO.FolderExists(Server.MapPath(PathValue))=False Then
			objFSO.CreateFolder Server.MapPath(PathValue)
		End If
		If Err.Number = 0 Then
			CreatePath = PathValue
		End If
	Set objFSO = Nothing
End Function
Sub Write_56770_Eshop(value)
	Response.Write(value)
End Sub
%>
</body>
</html>