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
%>| Member | Purpose |
|---|---|
Name, Path, Size | Read metadata. |
DateCreated, DateLastModified | Read timestamps. |
Copy, Move, Delete | Manage the file. |
OpenAsTextStream | Read or write text. |
Use only trusted paths under an application-controlled directory and grant the IIS identity the minimum filesystem permissions.