pthurmond Posted December 6, 2006 Share Posted December 6, 2006 Hey everybody, I am getting an error opening a file with php. This file is a template that I am trying to replace placeholders with variables.Here is the error:[quote]<br /><b>Warning</b>: file_get_contents(participants.rtf): failed to open stream: No such file or directory in <b>/home/content/p/a/l/paldata/html/TeamB/includes/file_funcs.php</b> on line <b>81</b><br />[/quote]Here is the code:[code]header( 'Content-type: application/msword' );header( 'Content-Disposition: inline, filename=Participant_Release.rtf');// open our template file$filename = 'participants.rtf';$output = file_get_contents($filename);[/code]Line 81 in the error is the last line of code above. The file is on the server in the exact same folder with the same exact spelling and capitalization.Any ideas?Thanks,Patrick Link to comment https://forums.phpfreaks.com/topic/29632-error-opening-a-file-with-php/ Share on other sites More sharing options...
The Little Guy Posted December 6, 2006 Share Posted December 6, 2006 is it in the same directory? You are telling it to stay in the current folder. Link to comment https://forums.phpfreaks.com/topic/29632-error-opening-a-file-with-php/#findComment-135996 Share on other sites More sharing options...
JasonLewis Posted December 6, 2006 Share Posted December 6, 2006 according to your code you are checking for participants.rtf in this directory: /home/content/p/a/l/paldata/html/TeamB/includes/are you sure thats where it is located? Link to comment https://forums.phpfreaks.com/topic/29632-error-opening-a-file-with-php/#findComment-136017 Share on other sites More sharing options...
pthurmond Posted December 6, 2006 Author Share Posted December 6, 2006 Yes, I uploaded both the script and the rtf file at the exact same time to the exact same directory.That is why this problem is really frustrating me. Link to comment https://forums.phpfreaks.com/topic/29632-error-opening-a-file-with-php/#findComment-136132 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.