Asp.net| Control | upload
This period of time wrote a asp.net upload large file control. After testing, the progress bar can be displayed in IE. Hereby share, hope that the vast number of netizens to comment.
Large File Upload Control (contains progress bar)
Instructions for use are as follows:
<summary>
Upload progress bar control
</summary>
<example>
Web.config configuration
<?xml version= "1.0"?>
<configuration>
<configSections>
<!--upload node-->
<sectiongroup name= "Slickupload" >
<section name= "Uploadlocationprovider" type= "Common.SlickUpload.Configuration.UploadLocationProviderHandler, Common "/>
</sectionGroup>
</configSections>
<system.web>
<add verb= "*" path= "commontoolsashx.ashx" type= "Common.Web.AppControl.CommonToolsASHX, Common"/>
<add verb= "*" path= "commontoolsashx_xml.ashx" type= "Common.Web.AppControl.CommonToolsASHX_XML, Common"/>
<!--upload modules-->
<add name= "Httpuploadmodule" type= "Common.SlickUpload.HttpUploadModule, Common"/>
</system.web>
<appSettings>
<!--upload temporary path-->
<add key= "Uploadpath" value= "C:\TDdownload\temp"/>
<!--license upload page, multiple pages with '; ' Separate-->
<add key= "Httpuploadmodulepagegoon" value= "upload.aspx;" />
</appSettings>
</configuration>
ASPX page
Top of
<%@ Register assembly= "Common" namespace= "Common.Web.AppControl" tagprefix= "CC1"%>
In form
<asp:fileupload id= "Fileuploadfile" runat= "Server"/>
<asp:button id= "Btnupload" runat= "Server" text= "Upload"/>
<asp:hyperlink id= "Hycancel" runat= "Server" >Cancel</asp:HyperLink>
<cc1:webuploadprogressbar id= "Webuploadprogressbarcontrol" runat= "Server" uploadpath= "C:\TDdownload" ></ Cc1:webuploadprogressbar>
ASPX corresponding CS code
protected void Page_Load (object sender, EventArgs e)
{
Binding upload client JavaScript events
This. Btnupload.onclientclick = this. Webuploadprogressbarcontrol.getuploadclick_javascript;
Binding upload canceling client JavaScript events
This.hyCancel.NavigateUrl = "javascript:" + this. Webuploadprogressbarcontrol.getuploadcancelclick_javascript;
}
protected void Btnupload_click (object sender, EventArgs e)
{
Uploading files
This. Webuploadprogressbarcontrol.saveuploadfiles ();
}
</example>
<remarks> you must set up ports or virtual directories under the IIS site to test the pass, and then please contact zljGood@hotmail.com </remarks>
If you have any questions, please contact zljGood@hotmail.com, email:zlj9000@hotmail.com