国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

用asp實現文件瀏覽、上傳、下載的程序

2024-05-04 10:58:24
字體:
來源:轉載
供稿:網友
可以放在服務器上,對服務器上的文件進行瀏覽、上傳、下載,可下載文件源碼。
把下所有代碼入在一個文件里即可,文件的后綴要為asp。
復制代碼 代碼如下:

<% 
thedir = request("thedir") 
if thedir = "" then 
 folderini = server.mappath(".")&"/" 
else 
 folderini = server.mappath(thedir)&"/" 
end if 

foldinfo=trim(Request.Querystring("foldinfo")) 
if foldinfo = "" then 
 foldinfo = folderini 
end if 

class clsUp 
Dim Form,File 
Dim AllowExt_  
Dim NoAllowExt_  
Private oUpFileStream  
Private isErr_   
Private ErrMessage_  
Private isGetData_  

Public Property Get Version 
 Version="v1.0.0" 
End Property 

Public Property Get isErr 
 isErr=isErr_ 
End Property 

Public Property Get ErrMessage 
 ErrMessage=ErrMessage_ 
End Property 

Public Property Get AllowExt 
 AllowExt=AllowExt_ 
End Property 

Public Property Let AllowExt(Value)  
 AllowExt_=LCase(Value) 
End Property 

Public Property Get NoAllowExt 
 NoAllowExt=NoAllowExt_ 
End Property 

Public Property Let NoAllowExt(Value) 
 NoAllowExt_=LCase(Value) 
End Property 

Private Sub Class_Initialize 
 isErr_ = 0 
 NoAllowExt=""   
 NoAllowExt=LCase(NoAllowExt) 
 AllowExt=""   
 AllowExt=LCase(AllowExt) 
 isGetData_=false 
End Sub 

Private Sub Class_Terminate  
 on error Resume Next 

 Form.RemoveAll 
 Set Form = Nothing 
 File.RemoveAll 
 Set File = Nothing 
 oUpFileStream.Close 
 Set oUpFileStream = Nothing 
End Sub 

Public Sub GetData (MaxSize) 

 on error Resume Next 
 if isGetData_=false then  
  Dim getupdata1,sSpace,bCrLf,sInfo,iInfoStart,iInfoEnd,tStream,iStart,oFileInfo 
  Dim sFormValue,sFileName 
  Dim iFindStart,iFindEnd 
  Dim iFormStart,iFormEnd,sFormName 

  If Request.TotalBytes < 1 Then  
   isErr_ = 1 
   ErrMessage_="" 
   Exit Sub 
  End If 
  If MaxSize > 0 Then  
   If Request.TotalBytes > MaxSize Then 
   isErr_ = 2  
   ErrMessage_="" 
   Exit Sub 
   End If 
  End If 
  Set Form = Server.CreateObject ("Scripting.Dictionary") 
  Form.CompareMode = 1 
  Set File = Server.CreateObject ("Scripting.Dictionary") 
  File.CompareMode = 1 
  Set tStream = Server.CreateObject ("ADODB.Stream") 
  Set oUpFileStream = Server.CreateObject ("ADODB.Stream") 
  oUpFileStream.Type = 1 
  oUpFileStream.Mode = 3 
  oUpFileStream.Open  
  oUpFileStream.Write Request.BinaryRead (Request.TotalBytes) 
  oUpFileStream.Position = 0 
  getupdata1 = oUpFileStream.Read  
  iFormEnd = oUpFileStream.Size 
  bCrLf = ChrB (13) & ChrB (10) 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 永济市| 儋州市| 乐亭县| 海盐县| 北川| 青川县| 明水县| 揭西县| 延寿县| 鹰潭市| 江永县| 沈丘县| 郑州市| 兴国县| 班玛县| 红安县| 兴业县| 增城市| 彭泽县| 红桥区| 云南省| 巩义市| 枝江市| 囊谦县| 康平县| 文昌市| 长沙市| 兴义市| 盐亭县| 蕉岭县| 汶上县| 榕江县| 崇义县| 金华市| 南投县| 新疆| 苍山县| 武威市| 浦东新区| 水富县| 屯留县|