{求}fso获取图片字节数的代码

daw020 2006-07-09 08:10:46
求fso获取图片的大小(字节数)的代码,网上搜了一下都是获取长宽的...
...全文
129 6 打赏 收藏 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
daw020 2006-07-09
  • 打赏
  • 举报
回复
帮帮忙啊
daw020 2006-07-09
  • 打赏
  • 举报
回复
我不懂怎么写啊 能给我写个代码吗?
lamking 2006-07-09
  • 打赏
  • 举报
回复
创建文件的object之后, obj.size就是字节数了,不需要什么其他的方法.fso的属性而已
daw020 2006-07-09
  • 打赏
  • 举报
回复
<%
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(server.mappath("../content/images/"&=imagewidth&"x"&=imageheight&""&=rs("preview")&""&=imageformat&""))
response.write "这个文件大小:"&f.size&"字节"
set fso=nothing
%>

错误类型:
Microsoft VBScript 编译器错误 (0x800A03EA)
语法错误
/uniwap17/listpic2.asp, line 76, column 56
Set f = fso.GetFile(server.mappath("../content/images/"&=imagewidth&"x"&=imageheight&""&=rs("preview")&""&=imageformat&""))
-------------------------------------------------------^
daw020 2006-07-09
  • 打赏
  • 举报
回复
谢谢 楼上的
lamking 2006-07-09
  • 打赏
  • 举报
回复
<%
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(server.mappath("test.txt"))
response.write "这个文件大小:"&f.size&"字节"
set fso=nothing
%>

28,402

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧