Asp. NET upload large file control

Source: Internet
Author: User
Tags file upload
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



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.