|
使用說明如下:
<summary>
上傳進(jìn)度條控件
</summary>
<example>
Web.config 配置
<?xml version="1.0"?>
<configuration>
<configSections>
<!--上傳節(jié)點(diǎn)-->
<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內(nèi)
<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對應(yīng)的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站點(diǎn)下設(shè)置端口或虛擬目錄方可測試通過,又問題請和zljGood@hotmail.com聯(lián)系</remarks>
AspNet技術(shù):asp.net 大文件上傳控件,轉(zhuǎn)載需保留來源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。