Skip to content
Related Articles

Related Articles

ASP size Property

Improve Article
Save Article
Like Article
  • Last Updated : 31 Mar, 2021

The ASP size property is used to return the size of the specified file or folder. It returns the value in terms of bytes.


  • For file Object:
  • For folder Object:

Example-1: Below code returns the size of a file. 


dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile("d:\GFG.asp")
Response.Write("The size of GFG.asp is: ")
Response.Write(f.Size & " bytes.")
set f=nothing
set fs=nothing


The size of GFG.asp is: 100323 bytes.

Example-2: Below code returns a size of a folder.


dim fs,fo
set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("d:\GFG")
Response.Write("The size of the folder test is: ")
Response.Write(fo.Size & " bytes.")
set fo=nothing
set fs=nothing


The size of the folder test is: 123456 bytes.
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!