if upload.form("GuFolderPath")<>"" then trueGuFolderPath=upload.form("GuFolderPath") truecall FolderNameCheck(GuFolderPath) trueGuFolderPath=upload.form("GuFolderPath") trueif right(GuFolderPath,1)<>"/" then GuFolderPath=GuFolderPath&"/"
elseif upload.form("GuFolderPath")="" and GuFolder0<>"" then trueGuFolderPath=GuFolder0 truecall FolderNameCheck(GuFolderPath) trueGuFolderPath=GuFolder0 trueif right(GuFolderPath,1)<>"/" then GuFolderPath=GuFolderPath&"/"
else trueGuFolderPath=""
end if
trueiCount=0
for each formName in upload.objFile '列出所有上传了的文件
trueset file=upload.file(formName)
trueif file.FileSize>0 then
truetruedim FileExtF,FileExtY,FileExtOK,ii,jj truetrueFileExtF=split(File.FileName,".") truetruefor jj=0 to ubound(FileExtF) truetruenext truetrueFileExtY=0 truetrueFileExtOK=split(GuFileExt0,"|") truetrue truetruefor ii=0 to ubound(FileExtOK) truetrueif FileExtOK(ii)=FileExtF(jj-1) then truetruetrueFileExtY=1 truetrueexit for truetrueend if truetruenext
truetrueif FileExtY=0 then truetruetrueHtmend "上传失败,不允许上传的文件类型"
truetrueelseif file.FileSize>GuFileSize0*1024 then truetruetrueHtmend "上传失败,单个文件大小超过限制,最大"&GuFileSize0&"*1024 字节,1K=1024字节"
truetrueelse truetruetruedim FileNameOK truetruetrueif GuAutoName="1" then truetruetruetrueFileNameOK=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&iCount&"."&FileExtF(jj-1) truetruetrueelse truetruetruetrueFileNameOK=file.FileName truetruetrueend if
truedim Letters,i,c trueLetters="+=:;,[]<>\|*?" truefor i=1 to len(FolderNameNew) truetruec=mid(FolderNameNew,i,1) truetrueif inStr(Letters,c)<>0 then truetrueHtmend "上传失败,文件夹名称含有特殊字符" trueend if truenext
trueGuFolderPath=server.MapPath(GuFolderPath) trueSet fso=Server.CreateObject("Scripting.FileSystemObject") trueif fso.FolderExists(GuFolderPath)=false then truetruefso.CreateFolder(GuFolderPath) trueend if trueSet fso=nothing
End sub
Sub HtmEnd(Msg) set upload=nothing response.write "<br>"&Msg&" <br><br><input type=""button"" value="" 返 回 "" onclick=""javascript:history.back();""></body></html>" response.end End sub %> </body> </html>
Copyright Notice: With the exception of the special statement at the beginning of the article, all articles can be reprinted in accordance with the CC BY 4.0 agreement with the author's permission.
Comments