国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

ASP.NET上傳大文件控件

2024-07-10 13:09:12
字體:
來源:轉載
供稿:網友

這段時間寫了個asp.net 上傳大文件控件。經過測試,在ie中可顯示進度條。特此共享,望廣大網友多提意見。

大文件上傳控件(包含進度條)

使用說明如下:

     <summary>
     上傳進度條控件
     </summary>
     <example>
     web.config 配置
     <?xml version="1.0"?>
    <configuration>
       <configsections>
          <!--上傳節點-->
          <sectiongroup name="slickupload">
             <section name="uploadlocationprovider" type="common.slickupload.configuration.uploadlocationproviderhandler, common"/>
          </sectiongroup>
       </configsections>
       <system.web>
          <httpruntime maxrequestlength="2024000" executiontimeout="300"/>
          <httphandlers>
         <add verb="*" path="commontoolsashx.ashx" type="common.web.appcontrol.commontoolsashx, common" />
         <add verb="*" path="commontoolsashx_xml.ashx" type="common.web.appcontrol.commontoolsashx_xml, common" />
          </httphandlers>
          <!--上傳modules-->
          <httpmodules>
         <add name="httpuploadmodule" type="common.slickupload.httpuploadmodule, common"/>
          </httpmodules>
       </system.web>
       <appsettings>
          <!--上傳臨時路徑-->
          <add key="uploadpath" value="c:/tddownload/temp"/>
          <!--許可上傳頁面,多個頁面用';'分開-->
          <add key="httpuploadmodulepagegoon" value="upload.aspx;"/>
       </appsettings>
    </configuration>

     aspx頁面
       //頂部
       <%@ register assembly="common" namespace="common.web.appcontrol" tagprefix="cc1" %>
        //form內
        <asp:fileupload id="fileuploadfile" runat="server" />
        <asp:button id="btnupload" runat="server" onclick="button1_click" text="upload" />
        <asp:hyperlink id="hycancel" runat="server">cancel</asp:hyperlink>
        <cc1:webuploadprogressbar id="webuploadprogressbarcontrol" runat="server" uploadpath="c:/tddownload"></cc1:webuploadprogressbar>


     aspx對應的cs代碼
            protected void page_load(object sender, eventargs e)
            {
                //綁定上傳客戶端javascript事件
                this.btnupload.onclientclick = this.webuploadprogressbarcontrol.getuploadclick_javascript;
                //綁定上傳取消客戶端javascript事件
                this.hycancel.navigateurl = "javascript:" + this.webuploadprogressbarcontrol.getuploadcancelclick_javascript;
            }
            protected void btnupload_click(object sender, eventargs e)
            {
                //上傳文件
                this.webuploadprogressbarcontrol.saveuploadfiles();       
            }
     </example>
     <remarks>必須在iis站點下設置端口或虛擬目錄方可測試通過,又問題請和[email protected]聯系</remarks>

 有問題請和[email protected]聯系, email:[email protected]

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 大田县| 蕉岭县| 甘德县| 乐都县| 巴林左旗| 溧阳市| 登封市| 孟州市| 资兴市| 唐海县| 天祝| 睢宁县| 拉萨市| 浠水县| 搜索| 英吉沙县| 克什克腾旗| 米易县| 黑水县| 庆城县| 秦安县| 丰城市| 阿合奇县| 牟定县| 桐柏县| 平南县| 颍上县| 尤溪县| 政和县| 吉首市| 恩施市| 石首市| 遂川县| 华安县| 江源县| 普安县| 彭州市| 庐江县| 昆明市| 沧州市| 通化市|