
<!--#include file="config.asp"-->
<!--#include file="../common/function.asp"-->
<!--#include file="../common/up_class.asp"-->
<%
'On Error Resume Next
Server.ScriptTimeOut=888

    Set upload=new Upload_File '建立名为upload新上传对象
    Set ObjFile=upload.file("FileData")

    '处理文件名，应验证格式需要放在前面
	FilePrefixName=DateToStr(Now(),"YmdHIS")&randomStr(0,4)
	FileName=FilePrefixName&"."&ObjFile.FileExt
	
	'将扩名名改为小写
	FileExt=LCase(ObjFile.FileExt)
	
	If FileExt="jpg" or FileExt="gif" or FileExt="jpg" or FileExt="png" Then
	Else
		Response.End()
	End If
	
	'处理使用时的上传文件夹
    UpPath=h_UpRoot&"" '定义上传路径
    '利用上传类的SaveAs方法对上传的文件进行保存
    ObjFile.SaveAs Server.mappath(UpPath&"/"&FileName)
	
	'处理使用时的上传文件夹
    UpPath=h_UpRoot&"" '定义上传路径
    '利用上传类的SaveAs方法对上传的文件进行保存
    ObjFile.SaveAs Server.mappath(UpPath&"/"&FileName)
	
	'获取文件路径
    FileURL=UpPath&"/"&FileName
	
	'aspJpeg处理图片
	If BolCheckObj("Persits.Jpeg")=True Then
		SmallW=307
		SmallPicH=230
		
		MediumW=600
		MediumPicH=450
		
		LargeW=1800
		LargePicH=1350
		
		Select Case generate
			Case "s"
				ResizeImg FileURL,UpPath&"/thum_s_"&FileName,SmallW,SmallPicH
			Case "sm"
				ResizeImg FileURL,UpPath&"/thum_s_"&FileName,SmallW,SmallPicH
				ResizeImg FileURL,UpPath&"/thum_m_"&FileName,MediumW,MediumPicH
			Case "sml"
				ResizeImg FileURL,UpPath&"/thum_s_"&FileName,SmallW,SmallPicH
				ResizeImg FileURL,UpPath&"/thum_m_"&FileName,MediumW,MediumPicH
				ResizeImg FileURL,UpPath&"/thum_l_"&FileName,LargeW,LargePicH
		End Select
	End If
	
	Response.write (FileName)
	
    Set upload=Nothing
    Set file=Nothing
%>