国产探花免费观看_亚洲丰满少妇自慰呻吟_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]

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 托里县| 临沧市| 工布江达县| 雷州市| 阳东县| 疏附县| 泸州市| 中超| 孟州市| 平罗县| 中山市| 阿勒泰市| 民勤县| 循化| 新沂市| 射洪县| 五大连池市| 行唐县| 台安县| 鸡泽县| 南华县| 安陆市| 翁牛特旗| 甘南县| 文山县| 华亭县| 社会| 肥城市| 定安县| 镇宁| 侯马市| 宁河县| 常州市| 崇礼县| 西乌| 伊通| 原平市| 江都市| 云阳县| 察哈| 拜城县|