asp.net文件上傳進度條控件(破解版~沒時間限制)多項自定義

原版只能用30天,這個破解版可以長期用了(設置了時間2010-2110).

曾祥展

 

註冊控件:

<%@ Register TagPrefix="fup" Namespace="OboutInc.FileUpload" Assembly="FileUpload" %>

 

調用控件:

<form runat="server" id="form1">
  <input type="file" name="myFile1" /><br/>
  <input type="file" name="myFile2" /><br/>
  <input type="file" name="myFile3" /><br/>
  <ASP:LinkButton runat="server" text="上傳" />
  &nbsp;&nbsp;&nbsp;
  <ASP:LinkButton runat="server" text="取消" onClientClick="Cancel(); return false;" /><br/>
  <br/>
 <fup:FileUploadProgress 
       OnClientProgressStopped   = "function(){alert('文件已上傳');}"
       OnClientProgressStarted   = "Clear"
       OnClientServerException   = "ServerException"
       ShowUploadedFiles         = "true"
       runat                     = "server"
       ID                        = "uploadProgress"
       InnerFiles                = "true"
       StyleFile                 = "fup_styles/myStyle.css"
  LocalizationFile="fup_localization/en.xml" />
       

後臺代碼:

OboutFileCollection files = uploadProgress.Files;           
for(int i=0; i < files.Count; i++)
{
   OboutPostedFile file = files[i];
   file.SaveAs(MapPath("~/Uploaded/"+Path.GetFileName(file.FileName)));
}
文件結構:
  下載地址:FileUploadProgress.rar   
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章