网页资讯视频图片知道文库贴吧地图采购
进入贴吧全吧搜索

 
 
 
日一二三四五六
       
       
       
       
       
       

签到排名:今日本吧第个签到,

本吧因你更精彩,明天继续来努力!

本吧签到人数:0

一键签到
成为超级会员,使用一键签到
一键签到
本月漏签0次!
0
成为超级会员,赠送8张补签卡
如何使用?
点击日历上漏签日期,即可进行补签。
连续签到:天  累计签到:天
0
超级会员单次开通12个月以上,赠送连续签到卡3张
使用连续签到卡
04月18日漏签0天
asp吧 关注:33,665贴子:110,974
  • 看贴

  • 图片

  • 吧主推荐

  • 视频

  • 游戏

  • 1回复贴,共1页
<<返回asp吧
>0< 加载中...

没事干,写的基于AspUpLoad的上传。

  • 只看楼主
  • 收藏

  • 回复
  • weibin_1988
  • 赛驰网络
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
<%
'检测组件
Function IsObjInstalled(strClassString)
     On Error Resume Next
     IsObjInstalled = False
     Err=0
     Dim xTestObj
     Set xTestObj = Server.CreateObject(strClassString)
     If 0 = Err Then IsObjInstalled = True
     Set xTestObj = Nothing
     Err = 0
End Function
'基于AspUpLoad的上传类
Class AspUpLoad
     Private ImageCover'是否覆盖
     Private ImageMaxSize'上传大小
     Private ImageExt '文件名
     Private ImageFile '保存路径
     '是否覆盖
     Public Property Let Cover(v)
         ImageCover=v
     End Property
     Public Property Get Cover()
         Cover=ImageCover
     End Property
     '文件大小
     Public Property Let MaxSize(v)
         ImageMaxSize=v
     End Property
     Public Property Get MaxSize()
         MaxSize=ImageMaxSize
     End Property
     '文件名
     Public Property Let Ext(v)
         ImageExt=v
     End Property
     Public Property Get Ext()
         Ext=ImageExt
     End Property
     '保存路径
     Public Property Let Path(v)
         ImageFile=v
     End Property
     Public Property Get Path()
         Path=ImageFile
     End Property
     '初始化数据
     Public Sub Class_Initialize        
         ImageCover=False
         ImageMaxSize=10*1024
         ImageExt=".jpg|.gif|.bmp"
         ImageFile="."
     End Sub
    
     Public Sub Open(UpLoad,MyFiles)
         Dim ThisExt
         Dim Cont
         If IsObjInstalled("Persits.Upload") then
             Set Upload = Server.CreateObject("Persits.Upload")



  • weibin_1988
  • 赛驰网络
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
             Upload.OverwriteFiles = ImageCover
             Upload.SetMaxsize ImageMaxSize,True
             Cont=Upload.Save()
             '没有选择文件
             If Cont<1 then
                 Response.Write(Error(2))
             End If
            
             For each MyFiles in Upload.Files
                 If Not CheckFileExt(MyFiles.Ext) then
                     Response.Write(MyFiles.FileName&": "&Error(3))
                     Exit For
                 End If
                 newname = year(now()) & month(now()) & day(now()) & hour(now()) & minute(now()) & second(now())
                 MyFiles.SaveAs Server.MapPath(ImageFile) & "\" & newname & MyFiles.Ext
             Next
         Else
             Response.Write Error(1)
         End If
     End Sub
    
     Private Function CheckFileExt(fileEXT)
         filetype=split(ImageExt,"|")
         for i=0 to ubound(filetype)
             If fileExt=filetype(i) then
                 CheckFileExt=true
                 Exit Function
             Else
                 CheckFileExt=false
             End If
         next
     End Function
    
     Public Function Error(v)
         If v=1 then
             Error="Internet No AspUpLoad Object!"
         ElseIf v=2 then
             Error="No Files!"
         ElseIf v=3 then
             Error="Files Type False!"
         ElseIf v=4 then
             Error="Files Size Max!"
         Else
             Error=0
         End If
     End Function
     Public Sub Class_Terminate
        
     End Sub
    
End Class
%>


登录百度账号

扫二维码下载贴吧客户端

下载贴吧APP
看高清直播、视频!
  • 贴吧页面意见反馈
  • 违规贴吧举报反馈通道
  • 贴吧违规信息处理公示
  • 1回复贴,共1页
<<返回asp吧
分享到:
©2026 Baidu贴吧协议|隐私政策|吧主制度|意见反馈|网络谣言警示