Awanka Posted September 24, 2007 Share Posted September 24, 2007 The following line: $fcontents = file("/resources/weekly_highlights/HighlightsList.txt"); throws the following error: Warning: file(/resources/weekly_highlights/HighlightsList.txt) [function.file]: failed to open stream: No such file or directory in C:\APPS_DEV\RM\Highlights.php on line 25 however the following works: "src="/resources/weekly_highlights/HighlightsList.txt" I can't figure out why this error is occurring. /resources/ is a virtual directory pointing to another server if that matters. Quote Link to comment https://forums.phpfreaks.com/topic/70546-error-with-open-streamfile/ Share on other sites More sharing options...
freakstyle Posted September 24, 2007 Share Posted September 24, 2007 if the folder "resources" is not at the root of your web server, you won't be able to to refer to it as the root, if its above the root then you need to adjust your call to that file. you could also use the ip to that and link from there, ie: <?php $FileDirIp = 'http://100.100.01.01'; $fcontents = file($FileDirIp . "/resources/weekly_highlights/HighlightsList.txt"); Good luck Quote Link to comment https://forums.phpfreaks.com/topic/70546-error-with-open-streamfile/#findComment-354436 Share on other sites More sharing options...
Awanka Posted September 24, 2007 Author Share Posted September 24, 2007 I can't use a direct http:// link. I run into access issues. Access is only allowed through the resources virtual directory. My question basically is what kind of pathnames can src= accept that file functions like file() cannot. what's the difference between the sort of pathnames the two use. I think it's probably something wierd like the pathname has to end with a "/". Quote Link to comment https://forums.phpfreaks.com/topic/70546-error-with-open-streamfile/#findComment-354461 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.