trampolinejoe Posted June 22, 2008 Share Posted June 22, 2008 Hey guys, I have some code, I need to save txt files to a certain folder on my web server where by my other software reads and opens the txt on my local server via a shared mapped ftp network drive. Here is the problem: $ourFileName ='/storage/'.$connote.'.txt'; $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file, something broke!"); I am trying to have it store in the sub folder called /storage/ The message it is giving me is: "failed to open stream: No such file or directory in" Points: - I have made sure that the directory is on the server - I have tested $ourFileName =$connote.'.txt'; which works I am a newbie to the fopen function and php so I wouldnt mind the help Cheers Guys Quote Link to comment https://forums.phpfreaks.com/topic/111288-solved-fopen-to-new-directory/ Share on other sites More sharing options...
Stephen Posted June 22, 2008 Share Posted June 22, 2008 Try removing the first forward slash (make it storage/ instead of /storage/) and see if it works. Quote Link to comment https://forums.phpfreaks.com/topic/111288-solved-fopen-to-new-directory/#findComment-571240 Share on other sites More sharing options...
trampolinejoe Posted June 22, 2008 Author Share Posted June 22, 2008 Hey Mate, That fixed it!! cheers!! Quote Link to comment https://forums.phpfreaks.com/topic/111288-solved-fopen-to-new-directory/#findComment-571245 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.