attach.jsp
上传用户:zhenfu
上传日期:2020-04-09
资源大小:137k
文件大小:5k
源码类别:

加密解密

开发平台:

CHM

  1. <%@ page language="java" pageEncoding="gb2312"%>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  5. <title>添加附件</title>
  6. <style type="text/css">
  7. body, td, span, div, input, select {
  8. font-size: 12px;
  9. font-family: "宋体", "Courier New", Courier, monospace;
  10. margin: 0px;
  11. }
  12. .input {
  13. border: 1px solid #7E9DB9;
  14. width: 250px;
  15. margin-left: 4px;
  16. height: 18px;
  17. }
  18. </style>
  19. <script language="JavaScript">
  20. <!--
  21. window.isIE = (navigator.appName == "Microsoft Internet Explorer");
  22. if(window.isIE) {
  23. if(navigator.userAgent.indexOf("Opera")>-1) window.isIE = null;
  24. }
  25. else {
  26. if(navigator.userAgent.indexOf("Gecko")==-1) window.isIE = null;
  27. }
  28. function $(sID) {
  29. return document.getElementById(sID);
  30. }
  31. function adjustDialog(){
  32. var w = $("tabDialogSize").offsetWidth + 6;
  33. var h = $("tabDialogSize").offsetHeight + 25;
  34. window.dialogLeft = (screen.availWidth - w) / 2;
  35. window.dialogTop = (screen.availHeight - h) / 2;
  36. }
  37. function resteText() {
  38. var editor = window.dialogArguments.EDiaryEditor;
  39. var frameWindow = editor.iframe.contentWindow;
  40. var selection = frameWindow.document.selection; 
  41. if (selection != null) {
  42. rng = selection.createRange();
  43. }
  44. $("linktext").value = rng.text ? rng.text : "";
  45. }
  46. function loadFileName(){
  47. var start=$("linkpath").value.lastIndexOf("\")+1;
  48. var end=$("linkpath").value.length;
  49. $("linktext").value=$("linkpath").value.substr(start,end);
  50. }
  51. window.onload = init;
  52. function init() {
  53. adjustDialog();
  54. resteText();
  55. $("linkpath").select();
  56. }
  57. function LoadAttach (path) {
  58. var editor = window.dialogArguments.EDiaryEditor;
  59. var oRTE = editor.iframe.contentWindow;
  60. var imgpath=location.href.substr(0,location.href.lastIndexOf("/")).replace("/editor","/images/common.gif");
  61. var html = "<img src='"+imgpath+"' align='absmiddle'><a href='" + path + "' target='_blank'>" + $("linktext").value + "</a>";
  62. if(window.isIE) {
  63. try{
  64. oRTE.focus();
  65. var oRng = oRTE.document.selection.createRange();
  66. oRng.pasteHTML(html);
  67. oRng.collapse(false);
  68. oRng.select();
  69. }catch(e){}
  70. }
  71. else {
  72. editor.runCMD('insertHTML', html);
  73. }
  74. window.close();
  75. }
  76. function chk_link(){
  77. if($("linkpath").value==""){
  78. alert("请选择要上传的附件!");
  79. return false;
  80. }
  81. if($("linktext").value==""){
  82. alert("请选择输入附件名称!");
  83. $("linktext").focus();
  84. return false;
  85. }
  86. $("form1").submit();
  87. $('divProcessing').style.display='';
  88. }
  89. document.onkeydown = function (el) {
  90. var event = window.event || el;
  91. if(event.keyCode == 13) {
  92.     return chk_link();
  93. }  
  94. }
  95. //-->
  96. </script>
  97. </head>
  98. <body>
  99. <table width="100%" height="100%" border="0" cellpadding="0"
  100. cellspacing="0" id="tabDialogSize">
  101. <tr>
  102. <td height="24" bgcolor="#DDE7EE" style="padding-left: 10px;">
  103. 添加附件
  104. <font color="#666666">(允许上传gif,jpg,jepg和png格式的附件)</font>
  105. </td>
  106. </tr>
  107. <tr>
  108. <td align="center">
  109. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  110. <form name="form1" id="form1" method="post"
  111. action="upload.asp?action=upload&uploadtype=attach"
  112. enctype="multipart/form-data" target="myiframe">
  113. <tr>
  114. <td width="70" height="28" align="right" valign="bottom">
  115. 上传附件:
  116. </td>
  117. <td align="left" valign="bottom">
  118. <input type="file" class="input" name="file1" id="linkpath"
  119. onChange="loadFileName()">
  120. </td>
  121. </tr>
  122. <tr>
  123. <td height="28" align="right" valign="bottom">
  124. 附件名称:
  125. </td>
  126. <td align="left" valign="bottom">
  127. <input type="text" class="input" id="linktext">
  128. </td>
  129. </tr>
  130. </form>
  131. </table>
  132. </td>
  133. </tr>
  134. <tr>
  135. <td height="40" align="center" style="padding-bottom: 10px;">
  136. <a href="#" onClick="chk_link()"><img border="0"
  137. src="../images/dilog_bt_ok.gif" alt="确定"
  138. style="margin-right: 10px;" />
  139. </a><a href="#" onClick="window.close();"><img border="0"
  140. src="../images/dilog_bt_cancel.gif" alt="取消" />
  141. </a>
  142. </td>
  143. </tr>
  144. <tr>
  145. <td bgcolor="#DDE7EE" height="5"></td>
  146. </tr>
  147. </table>
  148. <div id=divProcessing
  149. style="width:200px;height:30px;position:absolute;left:85px;top:75px;display:none">
  150. <table border="0" cellpadding="0" cellspacing="1" bgcolor="#333333"
  151. width="100%" height="100%">
  152. <tr>
  153. <td bgcolor="#3A6EA5" align="center">
  154. <font color=#FFFFFF>附件上传中,请等待...</font>
  155. </td>
  156. </tr>
  157. </table>
  158. </div>
  159. <iframe src="upload.asp" name="myiframe" id="myiframe"
  160. style="display:none"></iframe>
  161. </body>
  162. </html>