Open In App
Related Articles

ASP size Property

Improve Article
Improve
Save Article
Save
Like Article
Like

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

Syntax:

  • For file Object:
FileObject.Size 
  • For folder Object:
FolderObject.Size 

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

ASP




<%
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
%>


Output:

The size of GFG.asp is: 100323 bytes.

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

ASP




<%
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
%>


Output 

The size of the folder test is: 123456 bytes.
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 31 Mar, 2021
Like Article
Save Article
Previous
Next
Similar Reads
Complete Tutorials