Including text files in nodes.
I am looking for a way to include a text file, test.txt, into a node on creation. I have tried choosing Input Format as PHP and I put: <? include("test.txt"); ?> and got a large error: a.. warning: Unknown(test.txt): failed to open stream: No such file or directory in /home/ntc69/public_html/includes/common.inc(1342) : eval()'d code on line 1. a.. warning: Unknown(test.txt): failed to open stream: No such file or directory in /home/ntc69/public_html/includes/common.inc(1342) : eval()'d code on line 1. a.. warning: Unknown(test.txt): failed to open stream: No such file or directory in /home/ntc69/public_html/includes/common.inc(1342) : eval()'d code on line 1. I also played around with virtual () with no luck. How can I include another file in a node? Has anyone had any luck doing this? Help appreciated. Neil
Try using the full system path instead of just the file name. Adam Gaffin Executive Editor, NetworkWorld.com agaffin@nww.com / (508) 490-6433 / http://www.networkworld.com <http://www.networkworld.com/> "I programmed my robotic dog to bite the guy who delivers the electronic mail." -- Kibo ________________________________ From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Neil: esl-lounge.com Sent: Thursday, April 26, 2007 5:16 AM To: support@drupal.org Subject: [support] Including text files in nodes. I am looking for a way to include a text file, test.txt, into a node on creation. I have tried choosing Input Format as PHP and I put: <? include("test.txt"); ?> and got a large error: * warning: Unknown(test.txt): failed to open stream: No such file or directory in /home/ntc69/public_html/includes/common.inc(1342) : eval()'d code on line 1. * warning: Unknown(test.txt): failed to open stream: No such file or directory in /home/ntc69/public_html/includes/common.inc(1342) : eval()'d code on line 1. * warning: Unknown(test.txt): failed to open stream: No such file or directory in /home/ntc69/public_html/includes/common.inc(1342) : eval()'d code on line 1. I also played around with virtual () with no luck. How can I include another file in a node? Has anyone had any luck doing this? Help appreciated. Neil
Thanks Adam, that worked perfectly. ----- Original Message ----- From: Adam Gaffin To: support@drupal.org Sent: Thursday, April 26, 2007 3:56 PM Subject: Re: [support] Including text files in nodes. Try using the full system path instead of just the file name. Adam Gaffin Executive Editor, NetworkWorld.com agaffin@nww.com / (508) 490-6433 / http://www.networkworld.com "I programmed my robotic dog to bite the guy who delivers the electronic mail." -- Kibo ------------------------------------------------------------------------------ From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Neil: esl-lounge.com Sent: Thursday, April 26, 2007 5:16 AM To: support@drupal.org Subject: [support] Including text files in nodes. I am looking for a way to include a text file, test.txt, into a node on creation. I have tried choosing Input Format as PHP and I put: <? include("test.txt"); ?> and got a large error: a.. warning: Unknown(test.txt): failed to open stream: No such file or directory in /home/ntc69/public_html/includes/common.inc(1342) : eval()'d code on line 1. a.. warning: Unknown(test.txt): failed to open stream: No such file or directory in /home/ntc69/public_html/includes/common.inc(1342) : eval()'d code on line 1. a.. warning: Unknown(test.txt): failed to open stream: No such file or directory in /home/ntc69/public_html/includes/common.inc(1342) : eval()'d code on line 1. I also played around with virtual () with no luck. How can I include another file in a node? Has anyone had any luck doing this? Help appreciated. Neil ------------------------------------------------------------------------------ -- [ Drupal support list | http://lists.drupal.org/ ]
participants (2)
-
Adam Gaffin -
Neil: esl-lounge.com