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: TDdownloademp"/>
<! -- Allow uploading pages. Multiple pages are used; Separate -->
<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 code corresponding to ASPX
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.