uploadMedia.aspx
上传用户:lanchensha
上传日期:2022-02-27
资源大小:7530k
文件大小:13k
源码类别:

编辑器/阅读器

开发平台:

C#

  1. <%@ Page Language="C#" AutoEventWireup="true" Inherits="DotNetTextBox.UpLoad" %>
  2. <%@ Import Namespace="DotNetTextBox" %>
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  6. <title><%=ResourceManager.GetString("insertmediatitle")%></title>
  7. <base target="_self" />
  8. <script language="javascript" type="text/javascript">
  9. var userAgent = navigator.userAgent.toLowerCase();
  10. var is_ie = (userAgent.indexOf('msie') != -1);
  11. function loading() 
  12. {
  13.     document.getElementById("loading").style.visibility="visible";
  14.     return true;
  15. }
  16. function newMedia() 
  17. {
  18.     if(document.getElementById("file_path").value!="")
  19.     {
  20.     var arr=new Array;
  21.     arr[0]=document.getElementById("file_path").value.replace(/s/g,"%20")
  22.     arr[1]=document.getElementById("mediaWidth").value;
  23.     arr[2]=document.getElementById("mediaHeight").value;
  24.     arr[3]=document.getElementById("vol").value;
  25.     arr[4]=document.getElementById("loop").checked;
  26.     if(is_ie)
  27.     {
  28.     window.returnValue = arr;
  29.     }
  30.     else
  31.     {
  32.     window.opener.checkMedia(null,arr);
  33.     }
  34.     }
  35.     window.close();
  36. }
  37. function add(name) 
  38. {
  39. filetype=name.split(".");
  40. switch(filetype[filetype.length-1].toLowerCase())
  41. {
  42. case "swf":
  43. document.getElementById("mediaWidth").value="300";
  44. document.getElementById("mediaHeight").value="300";
  45. break;
  46. case "mov":
  47. document.getElementById("mediaWidth").value="400";
  48. document.getElementById("mediaHeight").value="300";
  49. break;
  50. case "asf":
  51. document.getElementById("mediaWidth").value="300";
  52. document.getElementById("mediaHeight").value="200";
  53. break;
  54. case "asx":
  55. document.getElementById("mediaWidth").value="300";
  56. document.getElementById("mediaHeight").value="200";
  57. break;
  58. case "wmv":
  59. document.getElementById("mediaWidth").value="300";
  60. document.getElementById("mediaHeight").value="200";
  61. break;
  62. case "wma":
  63. document.getElementById("mediaWidth").value="300";
  64. document.getElementById("mediaHeight").value="70";
  65. break;
  66. case "wmf":
  67. document.getElementById("mediaWidth").value="300";
  68. document.getElementById("mediaHeight").value="200";
  69. break;
  70. case "avi":
  71. document.getElementById("mediaWidth").value="400";
  72. document.getElementById("mediaHeight").value="300";
  73. break;
  74. case "mpeg":
  75. document.getElementById("mediaWidth").value="400";
  76. document.getElementById("mediaHeight").value="300";
  77. break;
  78. case "mpg":
  79. document.getElementById("mediaWidth").value="400";
  80. document.getElementById("mediaHeight").value="300";
  81. break;
  82. case "rm":
  83. document.getElementById("mediaWidth").value="400";
  84. document.getElementById("mediaHeight").value="300";
  85. break;
  86. case "rmvb":
  87. document.getElementById("mediaWidth").value="400";
  88. document.getElementById("mediaHeight").value="300";
  89. break;
  90. case "mp3":
  91. document.getElementById("mediaWidth").value="300";
  92. document.getElementById("mediaHeight").value="70";
  93. break;
  94. case "mp4":
  95. document.getElementById("mediaWidth").value="300";
  96. document.getElementById("mediaHeight").value="70";
  97. break;
  98. case "ra":
  99. document.getElementById("mediaWidth").value="300";
  100. document.getElementById("mediaHeight").value="70";
  101. break;
  102. case "wav":
  103. document.getElementById("mediaWidth").value="300";
  104. document.getElementById("mediaHeight").value="70";
  105. break;
  106. case "mid":
  107. document.getElementById("mediaWidth").value="300";
  108. document.getElementById("mediaHeight").value="70";
  109. break;
  110. case "midi":
  111. document.getElementById("mediaWidth").value="300";
  112. document.getElementById("mediaHeight").value="70";
  113. break;
  114. case "flv":
  115. document.getElementById("mediaWidth").value="352";
  116. document.getElementById("mediaHeight").value="288";
  117. break;
  118. default:
  119. document.getElementById("mediaWidth").value="300";
  120. document.getElementById("mediaHeight").value="200";
  121. break;
  122. }
  123. document.getElementById("file_path").value=path+name;
  124. document.getElementById("file_path").focus();
  125. }
  126. </script>
  127. <link href="stylesheet.css" rel="stylesheet" type="text/css" />
  128. </head>
  129. <body topmargin="0">
  130.     <form id="uploadFace" runat="server">
  131.         <table border="0" align=center style="word-break:break-all" width="100%">
  132.             <tr>
  133.                 <td colspan="3" rowspan="3">
  134.                     <fieldset><legend><span style="color: darkgray"><span style="color: gray"><%=ResourceManager.GetString("uploadface")%></span>&nbsp;
  135.                     </span></legend>
  136.         <%=ResourceManager.GetString("uploadpath")%>:<asp:Label ID="path" runat="server" ForeColor="Black"></asp:Label><br />
  137.         <%=ResourceManager.GetString("uploadfiles")%>:<asp:FileUpload ID="FileUpload1" runat="server" Width="388px" Height="21px" TabIndex="2" Font-Size="10pt" />
  138.         <asp:Button ID="uploadBtn" runat="server" OnClientClick="loading()" OnClick="UploadBtn_Click"/><br />
  139.         <%=ResourceManager.GetString("filepath")%>:<asp:TextBox ID="file_path" runat="server" Width="316px" TabIndex="1"></asp:TextBox><input language="javascript" name="insertFile" onclick="javascript:newMedia()" type="button" value='<%=ResourceManager.GetString("insertmedia")%>'  id="insert" /><br /> 
  140.                         [ <%=ResourceManager.GetString("uploaduse")%>:<asp:label ID="useSpace" ForeColor="Red" runat=server />,<%=ResourceManager.GetString("have")%>:<asp:label ID="space" ForeColor="Red" runat=server /><%=ResourceManager.GetString("singlesize")%>:<asp:Label ID="maxSingleUploadSize" runat="server" ForeColor="Red"></asp:Label>
  141.                         ]</fieldset>
  142.                     <fieldset style="text-align: center"><legend><span style="color: darkgray"><span style="color: gray"><%=ResourceManager.GetString("filelist")%></span>&nbsp;
  143.                     </span></legend>
  144.         <div style="border-right: 1.5pt inset; border-top: 1.5pt inset; vertical-align: middle;
  145.             overflow: auto; border-left: 1.5pt inset; width: 100%; border-bottom: 1.5pt inset;
  146.             height: 240px; background-color: white">
  147. <asp:GridView runat="server" id="File_List" HeaderStyle-HorizontalAlign=Center AutoGenerateColumns="False" HeaderStyle-BackColor="buttonface" HeaderStyle-ForeColor=windowtext HeaderStyle-Font-Bold="True" Width="100%" BorderWidth="1px" OnRowCancelingEdit="File_List_RowCancelingEdit" OnRowUpdating="File_List_RowUpdating">
  148.   <Columns>
  149.   <asp:TemplateField>
  150.         <HeaderTemplate>
  151.                 <asp:CheckBox ID="checkall" runat="server" Text=<%#ResourceManager.GetString("selectall")%> AutoPostBack="true" OnCheckedChanged="checkAll" />
  152.          </HeaderTemplate>
  153.           <ItemTemplate>
  154.                    <asp:CheckBox ID="check" runat="server" />
  155.             </ItemTemplate>     
  156.             <ItemStyle HorizontalAlign="Center" Width="55px" />
  157. </asp:TemplateField>
  158.     <asp:TemplateField>
  159.     <EditItemTemplate>
  160.     <asp:TextBox ID="editName" Text=<%#DataBinder.Eval(Container.DataItem,"Name").ToString().Remove(DataBinder.Eval(Container.DataItem,"Name").ToString().LastIndexOf(DataBinder.Eval(Container.DataItem,"Extension").ToString()))%> Width="100px" runat=server></asp:TextBox> <asp:Button ID="editBtn" CommandName="Update" CommandArgument=<%#DataBinder.Eval(Container.DataItem,"Name")%> runat=server Text=<%#ResourceManager.GetString("edit")%> /> <asp:Button ID="Cancel" runat=server Text=<%#ResourceManager.GetString("cancel")%> CommandName="Cancel" />
  161.     </EditItemTemplate>
  162.     <ItemTemplate>
  163.     <img src="img/filetype/<%#DataBinder.Eval(Container.DataItem,"Attributes").ToString().ToLower()=="directory"?"folder":((string)DataBinder.Eval(Container.DataItem,"Extension")).Replace(".","")%>.gif" /><asp:Label ID="ListID" Text=<%#DataBinder.Eval(Container.DataItem,"Name")%> style="cursor:pointer; word-break:break-all" onmouseover="this.style.textDecoration='underline'" onmouseout="this.style.textDecoration='none'" onclick=<%#DataBinder.Eval(Container.DataItem,"Name","javascript:add("{0}")")%> runat=server />
  164.     </ItemTemplate>
  165.     </asp:TemplateField>
  166.     <asp:BoundField DataField="LastWriteTime" ReadOnly="True" HtmlEncode=False DataFormatString="{0:D}" >
  167.         <ItemStyle HorizontalAlign="Center" Width="25%" />
  168.     </asp:BoundField>
  169.     <asp:BoundField DataField="Length" ReadOnly="True" HtmlEncode=False DataFormatString="{0:#,### Bytes}" >
  170.         <ItemStyle HorizontalAlign=Center Width="25%" />
  171.     </asp:BoundField>
  172.   </Columns>
  173. <HeaderStyle Font-Bold="True" ForeColor="WindowText" BackColor="Control" BorderWidth="1px" HorizontalAlign="Center" />
  174. </asp:GridView></div><table width="100%" border="0px"><tr><td height="40">
  175.     <%=ResourceManager.GetString("width")%>:<input id="mediaWidth" maxlength="10" style="width: 45px" type="text" value="300" />px
  176.     &nbsp;<%=ResourceManager.GetString("height")%>:<input
  177.         id="mediaHeight" maxlength="10" style="width: 45px" type="text" value="200" />px
  178.     &nbsp;
  179.     <%=ResourceManager.GetString("volume")%>:<input id="vol" maxlength="100" style="width: 30px" type="text" size="" value="90" />%&nbsp;<input id="loop" type="checkbox" checked="CHECKED" /><%=ResourceManager.GetString("loop")%><br />
  180.     [<%=ResourceManager.GetString("controlmenu")%>]:<asp:button id="selectAllBtn" runat="server"  borderstyle="Dashed" onclick="selectAllBtn_Click"></asp:button>
  181.                         <asp:Button ID="deleteBtn" runat="server" BorderStyle="Dashed" OnClick="deleteBtn_Click" />&nbsp;<asp:button id="editBtn" runat="server" borderstyle="Dashed" onclick="editBtn_Click" ></asp:button>
  182.     <input language="javascript" onclick="if(is_ie){showModalDialog('find.aspx',this,'dialogWidth:320px;dialogHeight:130px;status:0;scroll:no');}else{window.find();}"
  183.                             type="button" value='<%=ResourceManager.GetString("findfile")%>' />
  184.     <input language="javascript" onclick="window.close();" type="button" value="<%=ResourceManager.GetString("close")%>" /></td>
  185.     <td align="right">
  186.         <img border=0px src="img/logo_S.png" /></td>
  187. </tr></table>
  188.                         </fieldset>
  189.         <asp:HiddenField ID="config_watermark" runat="server" />
  190.         <asp:HiddenField ID="config_watermarkText" runat="server" />
  191.         <asp:HiddenField ID="config_watermarkImages" runat="server" />
  192.         <asp:HiddenField ID="config_watermarkImages_path" runat="server" />
  193.         <asp:HiddenField ID="config_smallImages" runat="server" />
  194.         <asp:HiddenField ID="config_smallImagesName" runat="server" />
  195.         <asp:HiddenField ID="config_maxAllUploadSize" runat="server" />
  196.         <asp:HiddenField ID="config_autoname" runat="server" />
  197.         <asp:HiddenField ID="config_allowUpload" runat="server" />
  198.         <asp:HiddenField ID="config_fileFilters" runat="server" />
  199.         <asp:HiddenField ID="config_maxSingleUploadSize" runat="server" />
  200.         <asp:HiddenField ID="config_fileListBox" runat="server" />
  201.         <asp:HiddenField ID="config_watermarkImagesName" runat="server" />
  202.         <asp:HiddenField ID="config_watermarkName" runat="server" />
  203.         <asp:HiddenField ID="config_smallImagesType" runat="server" />
  204.         <asp:HiddenField ID="config_smallImagesW" runat="server" />
  205.         <asp:HiddenField ID="config_smallImagesH" runat="server" />
  206.         <asp:HiddenField ID="config_type" Value="Media"  runat="server" />
  207.                 </td>
  208.             </tr>
  209.         </table>
  210.         <div id="loading" style="border-right: #333333 1px dashed; border-top: #333333 1px dashed;
  211.                         font-size: 9pt; visibility: hidden; border-left: #333333 1px dashed;
  212.                         width: 270px; color: #000000; border-bottom: #333333 1px dashed; position: absolute; height: 120px; background-color: #ffffff">
  213.                         <center>
  214.                             <br />
  215.                             <br />
  216.                             <%=ResourceManager.GetString("loading")%></center>
  217.                         <br />
  218.                         <center>
  219.                             <asp:Button ID="canceloading" runat="server" Style="border-top-style: dashed; border-right-style: dashed;
  220.                                 border-left-style: dashed; border-bottom-style: dashed" />&nbsp;</center>
  221.                         <br />
  222.                     </div>
  223.         <script type="text/javascript">
  224. var load=document.getElementById('loading');
  225. window.onload=function(){resizeLoad()};
  226. function resizeLoad()
  227. {
  228. load.style.top = parseInt((document.body.clientHeight-load.offsetHeight)/2+document.body.scrollTop);
  229. load.style.left = parseInt((document.body.clientWidth-load.offsetWidth)/2+document.body.scrollLeft);
  230. }
  231. if(is_ie)
  232. {
  233.     document.body.bgColor="ButtonFace";
  234.     var path=document.getElementById("path").innerText;
  235. }
  236. else
  237. {
  238.     document.body.bgColor="#E0E0E0";
  239.     var path=document.getElementById("path").textContent;
  240. }
  241. </script>      
  242. </form>
  243. </body>
  244. </html>