insertfile.asp

来自「top-cms内容管理系统」· ASP 代码 · 共 103 行

ASP
103
字号
<%
'###########################################################################################
'*  程序名称: Top-CMS
'*---------------------------------------------------------------------------------------
'*  系统版本: 1.0 0215
'*  版权所有: www.Net-Develop.com
'*  程序设计: 江南行客
'*  联系方式:
'*            OICQ:2503086
'*            EMAIL:net-oa@sohu.com
'*  网站地址: 
'*            http://www.net-develop.com  
'*            http://www.top-cms.com   
'*---------------------------------------------------------------------------------------
'*  Copyright 2004 www.net-develop.com - All Rights Reserved.
'###########################################################################################
%>
<!--#include file="../common/common.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="wed, 26 Feb 1997 08:21:57 GMT">
<link rel="stylesheet" href="css/css.css" type="text/css">
<script language="javascript">
<!--

function getFileExtension(filePath) { //v1.0
  fileName = ((filePath.indexOf('/') > -1) ? filePath.substring(filePath.lastIndexOf('/')+1,filePath.length) : filePath.substring(filePath.lastIndexOf('\\')+1,filePath.length));
  return fileName.substring(fileName.lastIndexOf('.'),fileName.length);
}

function CheckImgInsert() { //v1.0
	var extensions;
	extensions="<%=EditorAllowUpFileType%>";
	 if (extensions && extensions != '') {
		  	field = imgfrm.Files;
		  	if (field.value == '') {
				alert('对不起,请选择你要上传的附件。');
				return false;
		  	}
			if (extensions.toUpperCase().indexOf(getFileExtension(field.value).toUpperCase()) == -1) {
				alert('对不起,只能上传' + extensions + '类型文件。');
				return false;
	  		}
			tr1.style.display="none";
			tr2.style.display="inline";
			imgfrm.submit();
		}
}

function insert_file(sImg) {
			window.opener.ae_insertFile(sImg,imgfrm.alt.value);
			window.close();
		}
		
//-->

</script>

</head>
<body bgcolor="menu" style="border:0;overflow:	hidden;"> 
 <iframe name="uuu" id="uuu" width="0" height="0" scrolling="no" marginwidth=0 marginheight=0 frameborder=0 vspace=0 hspace=0></iframe><br>
<form name="imgfrm" method="post" action="upload.asp" enctype="multipart/form-data" target="uuu">
  <fieldset style="padding-bottom:5px"><legend disabled>上传附件</legend> 
   <table width="100%" border=0 cellpadding=0 cellspacing=0>
    <tr> 
      <td align="right"> 
        <table width="96%" border=0 cellpadding=0 cellspacing=0>
          <tr> 
      <td valign=middle height="12">链接文字: 
        <input name="alt" size="20">
      </td>
    </tr>
	 <tr id=tr1> 
      <td valign=middle height="12"> 
        选择文件:
		<input type="file" name="Files" size="16">
<input type="hidden" name="fType" value="File">
              <br>
              <br>
              <span disabled>[允许文件类型:<%=EditorAllowUpFileType%>]</span> 
            </td>
    </tr>
	<tr id=tr2 style="display:none;" > 
      <td align="center" valign="middle"> [正在上传附件,请稍候……]
      </td>
    </tr>
  </table>
  </td></tr></table>
  </fieldset> 
  <table width="98%" border=0 cellpadding=0 cellspacing=0 height="35">
  <tr><td align="right">
  <input type="button" name="OK" value=" 确定 " onclick="CheckImgInsert();">
    <input type=button onclick="javascript:window.close();" value=" 取消 ">
	</td>
  </tr>
  </table>
   </form>
 
</body>
</html>

⌨️ 快捷键说明

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