Forum Moderators: coopster

Message Too Old, No Replies

PHP text file help

         

andrewsmd

6:05 pm on Apr 23, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I need to create links that point to specific text files on our intranet. How would I make the link open a text file in a text editor. Is that even possible? I know about fread and all that but I would like it to open in wordpad or something like that. Here is the pseduo

<?php

echo("<a href = "linkToMyFile.txt">File.txt</a>");

?>

And I want that to open a file or at least open a download box to download the text file.

Also, I noticed that if I paste the path into my web browser, firefox opens something like this say my file name is

\\computer\folder\file.txt

Firefox does this
file::////computer/folder/file.txt
and it opens in a browser. However, if I put that as the url i.e.
<a href = "file::////computer/folder/file.txt">file</a>
then when I click it doesn't go anywhere any idea why? Thanks,

coopster

12:16 am on Apr 29, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Since it is on your intranet you may have control over the personal computers on the intranet. You can change the default browser options for text file handlers to force a download and open using the program you specify on each pc.

Other than that, the user controls how text files are opened and with which default handler on the client machine.