⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 upphoto.asp

📁 电子商务网络购物系统
💻 ASP
字号:
<% Option Explicit %>
<!--#include file="conn.asp" -->
<!--#include file="functions/uploadfun.asp" -->
<%
Response.Buffer = True

Dim strFileTypes
Dim intMaxFileSize
Dim intForumID
Dim strMessageBoxType
Dim blnFileUploaded
Dim strErrorMessage
Dim strFileUploadPath
Dim saryFileUploadTypes	
Dim intFileSize
Dim strUploadComponent
Dim lngErrorFileSize	
Dim blnExtensionOK
Dim strImageName

If bannedIP() Then
	Set rsConn = Nothing
	adoCon.Close
	Set adoCon = Nothing
	Response.Redirect("nopermission.asp?M=IP")
End If

blnExtensionOK = True
If blnAvatarUploadEnabled Then
	strSQL = "SELECT timescfg.* From timescfg;"
	rsConn.Open strSQL, adoCon
	If NOT rsConn.EOF Then
		strUploadComponent = rsConn("upcomponent")
		strFileUploadPath = rsConn("upphotopath")
		saryFileUploadTypes = Split(Trim(rsConn("upphototype")), ";")
		strFileTypes = rsConn("upphototype")
		intMaxFileSize = CInt(rsConn("upphotosize"))
	End If
End If
If Request.QueryString("PB") = "Y" Then
	Call checkSessionID(Request.QueryString("siD"))
	strImageName = fileUpload(strFileUploadPath, saryFileUploadTypes, intMaxFileSize, strUploadComponent, lngErrorFileSize, blnExtensionOK)
End If
Set rsConn = Nothing
adoCon.Close
Set adoCon = Nothing

%>
<html>
<head>


<title>上传头像</title>
<%
If lngErrorFileSize = 0 AND blnExtensionOK = True AND strImageName <> "" Then
%>	
<script  language="JavaScript">
	window.opener.document.frmRegister.txtAvatar.focus();
	window.opener.document.frmRegister.txtAvatar.value = "<% = strFileUploadPath & "/" & strImageName %>";
	window.opener.document.frmRegister.avatar.src = "<% = strFileUploadPath & "/" & strImageName %>";
	window.close();
</script><%
	
End If
%>
<script  language="JavaScript">
	function CheckForm () {
	var errorMsg = "";
	if (document.frmUpload.file.value==""){
		errorMsg += "\n\t文件错误";
	}
	if (errorMsg != ""){
		msg = "_______________________________________________________________\n\n";
		msg += "表单不完整,请填写完全\n";
		msg += "请修正后再发表\n";
		msg += "_______________________________________________________________\n\n";
		msg += "以下区域需要修改: \n";
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}else{
		alert("头像即将上传,单击确定后请等待!")
	}

	return true;
}
</script>
<!--#include file="includes/skin.asp" -->
</head>
<body bgcolor="<% = strBgColour %>" text="<% = strTextColour %>" background="<% = strBgImage %>" marginheight="0" marginwidth="2" topmargin="0" leftmargin="0" OnLoad="self.focus();">
<p>&nbsp;</p><table width="96%" border="0" cellspacing="0" cellpadding="1" align="center">
 <tr>
  <td align="center"><span class="heading">上传头像</span></td>
 </tr>
</table>
<br /><%
If blnAvatarUploadEnabled Then
	If blnExtensionOK = False Then %>
	<div align="center" class="text">文件格式错误<br />文件必须是: <%=  Replace(strFileTypes, ";", ", ", 1, -1, 1) %></div><br />
	<%
	ElseIf lngErrorFileSize <> 0 Then %>
	<div align="center" class="text">文件太大 <%= lngErrorFileSize %>KB.<br />头像最大值 <%= intMaxFileSize %>KB</div><br />
	<%	End If	%>
<table width="350" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="<% = strTableBorderColour %>">
 <tr>
  <td>
   <table border="0" align="center" cellpadding="4" cellspacing="1" width="350">
    <tr align="left" bgcolor="<% = strTableColour %>" background="<% = strTableBgImage %>">
     <td colspan="2" class="text" align="center">
     <table width="340" border="0" cellspacing="0" cellpadding="4">
     <form action="upphoto.asp?PB=Y&siD=<% = Session.SessionID %>" method="post" enctype="multipart/form-data" name="frmUpload" target="_self" id="frmUpload" onSubmit="return CheckForm();">
       <tr>
         <td align="center" class="text">选择头像.
          <br /><br />
          <input name="file" type="file" size="<% If BrowserType() = "Netscape 4" Then Response.Write("20") Else Response.Write("35") %>" />
          <br /><br />
          <input type="submit" name="Submit" value="上传" /> <br /><br />
          <span class="smText">头像格式必须是<%= Replace(strFileTypes, ";", ", ", 1, -1, 1) %>,头像最大值 <%= intMaxFileSize %>KB</span>
         </td>
       </tr>
       </form>
      </table>
      </td>
    </tr>
   </table></td>
 </tr>
</table><%

End If

%>
<table width="96%" border="0" cellspacing="0" cellpadding="1" align="center">
 <tr>
  <td align="center" height="34"><a href="JavaScript:onClick=window.close()">关闭窗口</a></td>
 </tr>
</table>
<br/><br/>
<!-- #include file="includes/footer.asp" -->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -