当前位置: 移动技术网 > IT编程>开发语言>.net > asp.net 大文件上传控件

asp.net 大文件上传控件

2018年04月18日  | 移动技术网IT编程  | 我要评论

恶魔奶爸手机下载,允许外链的相册,国王杯半决赛

大文件上传控件(包含进度条)
  使用说明如下:
   <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:tddownloadtemp"/>
     <!--许可上传页面,多个页面用';'分开-->
     <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站点下设置端口或虚拟目录方可测试通过,又问题请和zljgood@hotmail.com联系</remarks>

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网