Test if FileSystem Object is Correctly Installed

Run the code below to test if the FileSystem Object is correctly installed on your server.

<% Option Explicit %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>FSO Object Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;}
</style>
</head>
<body>

<%
Dim objFSO, sSavePath, sSaveFile
On Error Resume next
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
sSavePath = Request.ServerVariables("APPL_PHYSICAL_PATH")
Response.Write "Your current virtual directory: " & sSavePath
Set sSaveFile = objFSO.CreateTextFile(sSavePath & "FSOtest.txt", True)
sSaveFile.WriteLine("Testing the FSO by writing to a file.")
sSaveFile.Close
Set sSaveFile = nothing
Set objFSO = nothing
If Err.number<> 0 Then
Response.Write "<p style=""color:#FF0000;"">" & Err.Description & ".</p>"
End If
%>

<p>If you did not see any error message, the FileSystemObject is correctly installed.</p>
<p>Also check your current virtual directory and make sure the 'FSOtest.txt' file was created.</p>

</body>
</html>

Get the best ASP hosting with DiscountASP.NET - great value, money back guarantee.

Advertisements



MembersPro

MembersPro PayPal - ASP Membership software

Plug and play ASP membership script that integrates with PayPal to let you charge recurring membership fees.

Global ASP.NET Hosting Leader - Click Here