?? fileupload.asp
字號:
<!--#Include file="../Common/Inc_DatConn.asp"-->
<!--#Include file="Common/Inc_Config.asp"-->
<!--#Include file="Common/Inc_Function.asp"-->
<!--#Include file="Common/Upload.inc"-->
<%
'┌─ 風云ASP在線 ────────────────────────┐
'│ │
'│ 作者:趙振波. http://www.fyasp.com │
'│ │
'│ Q Q:176189168 │
'│ │
'│ Email:fy96@163.com │
'│ │
'│ 程序定做,系統開發,網站制作,提供高質量的網絡產品、技術和服務!│
'│ │
'│【版權聲明】 │
'│ │
'│ 本程序版權歸坐看風云所有,未經授權擅自修改、復制或散布本程序│
'│ │
'│的部分或全部,將承受嚴厲的民事和刑事處罰,對已知的違反者將給予法 │
'│ │
'│律范圍內的全面制裁。對非法使用此程序所造成的一切后果本人概不負責!│
'│ │
'└─────────────────── http://www.fyasp.com ──┘
%>
<%if IsTimeOut(Session("strAccount"),Session("strPassWord")) then Response.Redirect "index.asp"%>
<html>
<head>
<title><% = strSiteName%> - 網站后臺管理系統</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="Common/Site.css" type="text/css">
</head>
<body topmargin="5" leftmargin="5">
<%
dim upload,file,formName,intCot,intFileCot
dim strFileExt,strCurrentFolder,strFileName,strHeadFileName,strLastFileName
dim intFileSize
set Upload = new upload_5xSoft '建立上傳對象
if upload.Form("FilePath") = "" then
Response.Write "對不起,你沒有指定要上傳的目錄!<br><br><a href=""javascript:history.back();"">返回</a>"
set upload = nothing
else
strCurrentFolder = upload.Form("FilePath")
if Right(strCurrentFolder,1) <> "/" then
strCurrentFolder = strCurrentFolder &"/"
end if
end if
intCot = 0
intFileCot = 0
for each FormName in Upload.file '列出所有上傳了的文件
set File = Upload.file(FormName) '生成一個文件對象
if File.FileSize > 0 then '如果 FileSize > 0 說明有文件數據
strFileExt = Right(File.FileName,3)
if UCase(strFileExt) = "GIF" Or UCase(strFileExt) = "JPG" then
intFileCot = intFileCot + 1
strFileName = file.fileName
strHeadFileName = intUserKey & FormatTime(now(),7)
strFileName = strHeadFileName &"."& strFileExt
File.SaveAs Server.MapPath(strCurrentFolder & strFileName)
else
intCot = intCot + 1
end if
end if
set File = nothing
next
Response.Write "<br><br>照片上傳成功!<br><br>"
if UCase(Upload.Form("Oper")) = "ADDPHOTO" then
Response.Write "<script language=""Javascript"">this.close();window.opener.document.AddForm.PhotoName.value = '"& strFileName &"'</script>"
end if
if UCase(Upload.Form("Oper")) = "ADDPHOTO1" then
Response.Write "<script language=""Javascript"">this.close();window.opener.document.AddForm.PhotoName1.value = '"& strFileName &"'</script>"
end if
if UCase(Upload.Form("Oper")) = "ADDPHOTO2" then
Response.Write "<script language=""Javascript"">this.close();window.opener.document.AddForm.PhotoName2.value = '"& strFileName &"'</script>"
end if
set Upload = nothing '刪除此對象
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -