Classic ASP File Object

Last updated: August 26, 2026.

The File object returned by FileSystemObject.GetFile exposes metadata and file-management methods for one server-side file.

<%
Dim fso, file, path
Set fso = Server.CreateObject("Scripting.FileSystemObject")
path = Server.MapPath("/App_Data/report.txt")

If fso.FileExists(path) Then
    Set file = fso.GetFile(path)
    Response.Write Server.HTMLEncode(file.Name) & "<br>"
    Response.Write CLng(file.Size) & " bytes<br>"
    Response.Write file.DateLastModified
End If
%>
MemberPurpose
Name, Path, SizeRead metadata.
DateCreated, DateLastModifiedRead timestamps.
Copy, Move, DeleteManage the file.
OpenAsTextStreamRead or write text.

Use only trusted paths under an application-controlled directory and grant the IIS identity the minimum filesystem permissions.

admin

admin

Leave a Reply

Your email address will not be published.