Results 1 to 10 of 10

Thread: Autotext

  1. #1
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Amersfoort, Utrecht, Netherlands
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Autotext

    Hello All,

    Is it possible to show text on a webpage that is comming from a text file.
    So I create a website and someone else uploads a texts file, and the website is also howing that text on the page.

    And if this is possible, is it also possible to have some format codes in that text file?

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autotext

    The answer to your question is yes - but you'll need to do this with an ASP page.

    You can use the FileSystemObject/TextStream to open and read a text file.

    Something like:<pre><%@ Language=VBScript %>
    <% strPath = Server.MapPath("YourTextFile.txt")
    set fso = Server.CreateObject("Scripting.FileSystemObject")
    set ts = fso.OpenTextFile(strPath)

    strText = ts.ReadAll
    ts.Close
    %>

    <html>
    <head>
    </head>
    <body>
    <h1>Your document reads:</h1>
    <%Response.Write(strText)%>
    </body>
    </html></pre>

    Your second question regarding formatted text. The answer is yes. By default, the document will display formatted HTML. You can prevent this by placing < PRE > tags around the text file content (in the HTML part).

    HTH

  3. #3
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Amersfoort, Utrecht, Netherlands
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autotext

    Thanks Mark,

    Now I will start learning about ASP pages.
    Every day new things in live

  4. #4
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Amersfoort, Utrecht, Netherlands
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autotext

    BTW Mark,

    To make this work, does the provider to have ASP active or something?

  5. #5
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autotext

    Yes, this is correct. The web host must support ASP. This means it must have Windows (NT/2000/XP) as an Operating System.

    Unix hosts do not support ASP.

  6. #6
    2 Star Lounger
    Join Date
    Apr 2002
    Location
    Amersfoort, Utrecht, Netherlands
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autotext

    Mark,

    That's .....
    The provider is using Unix, and I suppose there is on Unix machines notting like ASP, is there?

  7. #7
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autotext

    I understand there is a version of ASP that runs on UNIX called Chilisoft, but I doubt it is the "same" ASP that is supported by Microsoft on the Windows platform.

    As a side note: I have recently convinced one of my clients to switch from their long-time Unix web-host to a Windows-based web host just for the benefit of ASP and ADO Database applications. They seem to be quite happy with the new situation.

    In my opinion, unless you already know, or plan to learn CGI/Perl, it is worth the investment to find a host that supports ASP.

  8. #8
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Coppell, Texas, USA
    Posts
    168
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autotext

    Unix has a number of languages that provide scripting and processing similar to ASP, and some would say better. Long before ASP on NT, Unix/Perl was running the internet (or so I've been told). If you see anything in your provider's offering about cgi-bin, that's where to look. Look for JSP as well.

    Your provider probably has some information about the type of scripting/programming support available. And there are lots of free utilities that run on UNIX/Linux hosts. Do some searching with Google (web and groups) and you may come up with a solution you can just drop in.

    I'd love to help more, but I'm an ASP guy myself.

  9. #9
    New Lounger
    Join Date
    Jun 2002
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autotext

    if you want to check if your provider supports PHP (another server side scripting language) just put something like this:

    <?php
    echo "Hello World";
    ?>

    into a text file with an ending of php or php3 (both common, depends on server configuration). if you want to know some more about that feel free to ask.

  10. #10
    2 Star Lounger
    Join Date
    Apr 2001
    Location
    Coppell, Texas, USA
    Posts
    168
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Autotext

    Don't know if this will be useful for what you're doing, but it's an example of the kind of resources you can find for free UNIX web utilities:

    http://www.freeperlcode.com/guide/Remote_S...nt/File_Upload/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •