|
- <%
- 'FSO获取文件大小,效果最佳,强烈推荐
- Public Function GetFileSize(FileName)
- Dim fso,drvpath,d,size,showsize
- set fso=server.createobject("scripting.filesystemobject")
- filepath=server.mappath(FileName)
- if fso.FileExists(filepath) then
- set d=fso.getfile(filepath)
- size=d.size
- GetFileSize=SIZE/1024 'FormatSize(size)
- Else
- GetFileSize=FileName&"file error!"
- End If
- set fso=nothing
- End Function
- '//数据流方式,不太精准,不推荐。
- Set Jpeg = Server.CreateObject("Persits.Jpeg")
- Jpeg.Open "D:\Sites\Site_D\3.jpg"
- response.Write(LenB(Jpeg.Binary))/1024
- RESPONSE.Write "<br>"
- response.Write GetFileSize("3.jpg")
- %>
复制代码
demo文件.rar
(87.28 KB, 下载次数: 0, 售价: 3 个ASP币)
没有深入研究,参考下:http://www.aspjpeg.com/object_aspjpeg.html#Binary |
|