📄 file_upload.asp
字号:
<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="common.asp" -->
<!--#include file="functions/functions_upload.asp" -->
<%
'****************************************************************************************
'** Copyright Notice
'**
'** Web Wiz Forums(TM)
'** http://www.webwizforums.com
'**
'** Copyright (C)2001-2008 Web Wiz(TM). All Rights Reserved.
'**
'** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM 'WEB WIZ'.
'**
'** IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN 'WEB WIZ' IS UNWILLING TO LICENSE
'** THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE
'** AND DERIVATIVE WORKS IMMEDIATELY.
'**
'** If you have not received a copy of the license with this work then a copy of the latest
'** license contract can be found at:-
'**
'** http://www.webwizguide.com/license
'**
'** For more information about this software and for licensing information please contact
'** 'Web Wiz' at the address and website below:-
'**
'** Web Wiz, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England
'** http://www.webwizguide.com
'**
'** Removal or modification of this copyright notice will violate the license contract.
'**
'****************************************************************************************
'*************************** SOFTWARE AND CODE MODIFICATIONS ****************************
'**
'** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE
'** AGREEMENT AND IS STRICTLY PROHIBITED
'**
'** If you wish to modify any part of this software a license must be purchased
'**
'****************************************************************************************
'Set the timeout of the page
Server.ScriptTimeout = 1000
'Set the response buffer to true as we maybe redirecting
Response.Buffer = True
'Dimension veriables
Dim strMode 'Holds the page mode (eg admin)
Dim lngUserProfileID 'Holds the profile ID of the user
Dim dblFileSpaceUsed 'Holds the amount of file space used
Dim strFileName 'Name of newly uploaded file
'If the user is not allowed kick 'em
If bannedIP() OR blnActiveMember = False OR blnBanned OR intGroupID = 2 OR (blnAttachments = false AND blnImageUpload = false) Then
'Clean up
Call closeDatabase()
'Redirect
Response.Redirect("insufficient_permission.asp" & strQsSID1)
End If
'Read in the mode of the page
strMode = Trim(Mid(Request.QueryString("M"), 1, 1))
'If this is not an admin but in admin mode then see if the user is a moderator
If blnAdmin = False AND strMode = "A" AND blnModeratorProfileEdit Then
'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT " & strDbTable & "Permissions.Moderate " & _
"FROM " & strDbTable & "Permissions " & _
"WHERE (" & strDbTable & "Permissions.Group_ID = " & intGroupID & " OR " & strDbTable & "Permissions.Author_ID = " & lngLoggedInUserID & ") AND " & strDbTable & "Permissions.Moderate=" & strDBTrue & ";"
'Query the database
rsCommon.Open strSQL, adoCon
'If a record is returned then the user is a moderator in one of the forums
If NOT rsCommon.EOF Then blnModerator = True
'Clean up
rsCommon.Close
End If
'Get the user ID of the memebr being edited by the admin and set to the users upload directory
If (blnAdmin OR (blnModerator AND CLng(Request.QueryString("PF")) > 2)) AND strMode = "A" Then
lngUserProfileID = CLng(Request.QueryString("PF"))
strUploadFilePath = strUploadOriginalFilePath & "/" & lngUserProfileID
'Get the logged in ID number
Else
lngUserProfileID = lngLoggedInUserID
End If
'If this is a postback upload the file
If Request.QueryString("PB") = "Y" Then
'Call upoload file function
If Request.QueryString("T") = "image" AND blnImageUpload Then
strFileName = fileUpload("image")
ElseIf blnAttachments Then
strFileName = fileUpload("file")
End If
'If the file has been uploaded then redirect to file manager
If lngErrorFileSize = 0 AND blnExtensionOK = True AND blnFileSpaceExceeded = False AND blnFileExists = False AND strFileName <> "" Then
'Go back to file manager
If strMode = "A" Then
Response.Redirect("file_manager.asp?UL=true&PF=" & lngUserProfileID & "&M=A" & strQsSID3)
Else
Response.Redirect("file_manager.asp?UL=true" & strQsSID3)
End If
End If
End If
'Clean up
Call closeDatabase()
'If active users is enabled update the active users application array
If blnActiveUsers Then
'Call active users function
saryActiveUsers = activeUsers("", strTxtFileManager, "file_manager.asp", 0)
End If
'Set bread crumb trail
strBreadCrumbTrail = strBreadCrumbTrail & strNavSpacer & "<a href=""file_manager.asp"
If strMode = "A" Then
strBreadCrumbTrail = strBreadCrumbTrail & "?PF=" & lngUserProfileID & "&M=A" & strQsSID2
Else
strBreadCrumbTrail = strBreadCrumbTrail & strQsSID1
End If
strBreadCrumbTrail = strBreadCrumbTrail & """>" & strTxtFileManager & "</a>" & strNavSpacer & strTxtFileUpload
%>
<!-- #include file="includes/browser_page_encoding_inc.asp" -->
<meta name="generator" content="Web Wiz Forums" />
<title><% = strTxtFileManager %></title>
<%
'***** START WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
Response.Write("<!--//" & _
vbCrLf & "/* *******************************************************" & _
vbCrLf & "Software: Web Wiz Forums(TM) ver. " & strVersion & "" & _
vbCrLf & "Info: http://www.webwizforums.com" & _
vbCrLf & "Copyright: (C)2001-2008 Web Wiz(TM). All rights reserved" & _
vbCrLf & "******************************************************* */" & _
vbCrLf & "//-->" & vbCrLf & vbCrLf)
'***** END WARNING - REMOVAL OR MODIFICATION OF THIS CODE WILL VIOLATE THE LICENSE AGREEMENT ******
%>
<script language="JavaScript">
//Function swap link type
function swapLinkType(selType){
if (selType.value == "imageUp"){
document.getElementById("fileProperties").style.display="none";
document.getElementById("imageProperties").style.display="block";<%
'If this is Gekco based browser or Opera the element needs to be set to visable
'If RTEenabled = "Gecko" OR RTEenabled = "opera" Then Response.Write(vbCrLf & " document.getElementById(""imageProperties"").style.visibility=""visable"";")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -