Re: Read in and display a text file?

From: Ray at <%=sLocation%> [MVP] (%=sLocation%)
Date: 02/25/04


Date: Wed, 25 Feb 2004 09:30:48 -0500

The SHOUTED line shouldn't be there. I forgot to delete it. Sorry about
that.

Ray at work

"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:OVaHQu6%23DHA.2636@TK2MSFTNGP09.phx.gbl...

>
>
> <object runat="server" progid="Scripting.FileSystemObject"
> id="oFSO"></object>
>
> <%
> MyFilename = Request.Form("MyFilename")
> sFilepath = Server.MapPath(MyFilename)
> If MyFilename <> "" Then
> If oFSO.FileExists(sFilepath) Then
> sContents = Server.HTMLEncode(oFSO.OpenTextFile(sFilepath, 1).ReadAll)
> RESPONSE.WRITE SCONTENTS
> End If
> Else
> sContents = "(File does not exist.)"
> End If
> %>
>
> <table>
> <tr>
> <td><%=MyFilename%></td>
> <td><%=sContents%></td>
> </tr>
> </table>


Loading