NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: astahl on May 09, 2013, 08:34:05 AM

Title: Showing a text file
Post by: astahl on May 09, 2013, 08:34:05 AM
How would you display the contents of a text file in the browser?


Ashley
Title: Re: Showing a text file
Post by: peterH on May 09, 2013, 09:54:10 AM
From the documentation:

 <!-- Net:f:FileName -->
Includes a (html) file at this point of the web page. Similar to the Clarion "INCLUDE" command. Use this to include static bits of HTML, stored in static files on the disk, inside dynamic web pages.
Tip: If the file contains raw text, not formatted HTML, then you can wrap the tag with the <pre> Html tags. For example
<pre>
<!-- Net:f:disclaimer.txt -->
</pre>

Peter
Title: Re: Showing a text file
Post by: Bruce on May 09, 2013, 10:21:51 PM
Hi Ashley,

Your question is slightly ambiguous. If you're asking how to include a text file into an html page - ie be part of a page, then use the F tag as Peter describes.

If you want the text file "as is" to appear in the browser, then just put it in the web folder or sub folder. At this point it is termed a "static file" and the user can get it in their browser simply by linking to it.  For example;

say you have a txt file, bob.txt, in the web folder. Then the url to it is
www.whatever.com\bob.txt

Cheers
Bruce
Title: Re: Showing a text file
Post by: astahl on May 10, 2013, 12:48:11 AM
Hi Peter and Bruce,

Thanks guys that's what I needed to know.


Ashley