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 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. 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!! 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
Archived
This topic is now archived and is closed to further replies.