%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
Upload
<%
ShowError_Custom="Call ShowError_WAP(id)"
Call System_Initialize
Call CheckReference("")
If Not CheckRights("FileUpload") Then Call ShowError(6)
dim upload,file,state,uploadPath,PostTime,isPicture
Randomize
PostTime=GetTime(Now())
Dim strUPLOADDIR
strUPLOADDIR = ZC_UPLOAD_DIRECTORY&"\"&Year(GetTime(Now()))&"\"&Month(GetTime(Now()))
Select Case Request.QueryString("act")
Case "upload"
Call CreatDirectoryByCustomDirectory(strUPLOADDIR)
Set upload=New UpLoadClass
upload.AutoSave=2
upload.Charset="UTF-8"
upload.FileType=Replace(ZC_UPLOAD_FILETYPE,"|","/")
upload.savepath=BlogPath & strUPLOADDIR &"\"
upload.maxsize=1024*1024*1024
upload.open
tExt=LCASE(upload.form("edtFileLoad_Ext"))
If tExt="png" Or tExt="jpg" Or tExt="gif" Or tExt="jpeg" Or tExt="bmp" Then isPicture=True
Dim Path
Path=Replace(BlogPath & strUPLOADDIR &"\" & upload.form("edtFileLoad_Name") ,"\","/")
Dim s
FileName=BlogHost & strUPLOADDIR &"\" & upload.form("edtFileLoad_Name")
Dim bolStu
If isPicture Then
bolStu=upload.Save("edtFileLoad",0)
Else
bolStu=upload.Save("edtFileLoad",1)
End If
If bolStu Then
Dim uf
Set uf=New TUpLoadFile
uf.AuthorID=BlogUser.ID
uf.AutoName=False
uf.IsManual=True
uf.FileSize=upload.form("edtFileLoad_Size")
uf.FileName=upload.form("edtFileLoad")
uf.UpLoad
End If
Dim nURL,tExt
nURL=Replace(BlogHost & strUPLOADDIR & "/"&upload.form("edtFileLoad"),"\","/")
If isPicture Then
strData="上传完成!继续上传"
response.write strData
response.end
End Select
%>