Classic ASP FileSystemObject

Last updated: August 26, 2026.

Scripting.FileSystemObject lets Classic ASP inspect folders and work with server-side files. Use only trusted paths under an application-controlled directory.

Create the object and inspect a file

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

If fso.FileExists(filePath) Then
    Response.Write Server.HTMLEncode(fso.GetFileName(filePath))
End If
Set fso = Nothing
%>

Common members

MemberPurpose
FileExists, FolderExistsCheck a path.
GetFile, GetFolderReturn file or folder objects.
CreateTextFile, OpenTextFileWrite or read text.
CopyFile, MoveFile, DeleteFileManage files.

Do not combine request values with filesystem paths. The IIS application-pool identity needs only the minimum required permissions, and downloadable or executable directories should not be writable by the application.

admin

admin

Leave a Reply

Your email address will not be published.