国产探花免费观看_亚洲丰满少妇自慰呻吟_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) 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 黑山县| 云南省| 清水县| 错那县| 黑水县| 临朐县| 莱州市| 离岛区| 临邑县| 酉阳| 华蓥市| 清丰县| 罗平县| 沾益县| 建始县| 广州市| 永靖县| 台南县| 长武县| 清丰县| 台中市| 洪雅县| 安阳县| 洱源县| 海门市| 望城县| 巴塘县| 开远市| 浑源县| 永春县| 六安市| 大余县| 深圳市| 肇源县| 固安县| 丹棱县| 柯坪县| 兴和县| 建湖县| 冷水江市| 阿拉善左旗|