The only thing you are using is the Scripting.FileSystem object, so your
best bet is that that is not (properly) installed. Get the following
download to check which components are installed:
It contains two files, one of which is an .asp file. put them in the same
dir of your web and run the .asp file.
Michiel van Otegem
ASPNL.com - ASP/ASP.NET/XML Teacher
ASPLists.com - Moderator
off-list email: michiel@a...
----- Original Message -----
To: "Code Clinic" <proasp_codeclinic@p...>
Sent: Wednesday, September 26, 2001 8:52 AM
Subject: [proasp_codeclinic] server objec failed
| I have the following code, when I run it I got the server.object failed.
| my code:
| <% @ Language = VBScript %>
| Option Explicit
| Response.Buffer = True
| Function FileRead(byVal FILE)
| Dim strOut : strOut = ""
| Dim objFSO, FileDownload
| Set objFSO = server.CreateObject("scripting.filesystemobject")
| 'set FileDownload = ObjFSO.OpenTextFile(FILE, 1, False)
| strOut = FileDownload.ReadAll()
| Set FileDownload = Nothing
| Set objFSO = Nothing
| FileRead = strOut
| End Function
| Dim strFileToDownload, strFileContents
| strFileToDownload = Request.QueryString("c:\excelfiles\unknown\test.txt")
| strFileContents = FileRead( strFileToDownload )
| response.AddHeader "Content-Disposition", "filename=" & strFileToDownload
| response.ContentType = "application/octet-stream"
| response.Write strFileContents
| Please advise.