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