NetTalk Central

Author Topic: Showing a text file  (Read 2991 times)

astahl

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
    • Email
Showing a text file
« on: May 09, 2013, 08:34:05 AM »
How would you display the contents of a text file in the browser?


Ashley
« Last Edit: May 09, 2013, 08:40:25 AM by astahl »

peterH

  • Sr. Member
  • ****
  • Posts: 413
    • View Profile
Re: Showing a text file
« Reply #1 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Showing a text file
« Reply #2 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

astahl

  • Sr. Member
  • ****
  • Posts: 308
    • View Profile
    • Email
Re: Showing a text file
« Reply #3 on: May 10, 2013, 12:48:11 AM »
Hi Peter and Bruce,

Thanks guys that's what I needed to know.


Ashley