During this time, I wrote an Asp.net upload large file control. After testing, the progress bar is displayed in IE. I would like to share with you more comments.
Large File Upload control (including progress bar)
The usage instructions are as follows:
<Summary>
Upload progress bar Control
</Summary>
<Example>
Web. config Configuration
<? XML version = "1.0"?>
<Configuration>
<Configsections>
<! -- Upload a node -->
<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>
<! -- Upload modules -->
<Httpmodules>
<Add name = "httpuploadmodule" type = "common. slickupload. httpuploadmodule, common"/>
</Httpmodules>
</System. Web>
<Deleetask>
<! -- Upload temporary path -->
<Add key = "uploadpath" value = "C: \ tddownload \ Temp"/>
<! -- Allow uploading pages. Separate multiple pages with ';' -->
<Add key = "httpuploadmodulepagegoon" value = "Upload. aspx;"/>
</Appsettings>
</Configuration>
ASPX page
// Top
<% @ Register Assembly = "common" namespace = "common. Web. appcontrol" tagprefix = "PC3" %>
// In form
<Asp: fileupload id = "fileuploadfile" runat = "server"/>
<Asp: button id = "btnupload" runat = "server" onclick = "button#click" text = "Upload"/>
<Asp: hyperlink id = "hycancel" runat = "server"> cancel </ASP: hyperlink>
<PC3: webuploadprogressbar id = "webuploadprogressbarcontrol" runat = "server" uploadpath = "C: \ tddownload"> </PC3: webuploadprogressbar>
CS corresponding to aspx Code
Protected void page_load (Object sender, eventargs E)
{
// Bind the upload client JavaScript event
This. btnupload. onclientclick = This. webuploadprogressbarcontrol. getuploadclick_javascript;
// Bind the upload cancel client JavaScript event
This. hycancel. navigateurl = "javascript:" + this. webuploadprogressbarcontrol. getuploadcancelclick_javascript;
}
Protected void btnupload_click (Object sender, eventargs E)
{
// Upload a file
This. webuploadprogressbarcontrol. saveuploadfiles ();
}
</Example>
<Remarks> you must set a port or virtual directory under the IIS Site to pass the test. If you have any questions, contact the zljGood@hotmail.com. </remarks>
contact the zljGood@hotmail.com if you have any questions, email: zlj9000@hotmail.com