Click to See Complete Forum and Search --> : getting image size


pelegk1
05-29-2003, 09:39 AM
how can i get by code the image size that is on the
server?

cmelnick
05-29-2003, 10:17 AM
If you want the size of the file, then use the following code (replacing c:\inetpub\....\img.jpg with the path to your image):


<%
Dim filesys, demofile, filesize
Set filesys = CreateObject("Scripting.FileSystemObject")
Set demofile = filesys.GetFile("c:\inetpub\wwwroot\pics\img.jpg")
filesize = demofile.Size
%>


If you want the dimensions of the width and height of the image, then check out Ze 4 Guys From Rolla (http://www.4guysfromrolla.com/webtech/050300-1.shtml).