Page 1 of 1

fopen() and fwrite() not working

Posted: Mon Apr 13, 2009 10:25 pm
by xplore
So this code used to work but then i re-structured the way it handles to make it easier for accessing the uploads yet it fails.

My root looks like this


index.php
upload.php



no errors occur but the text file 'list.txt' isn't being created, it isn't be written with the filename, and it obviously isn't closing if its not opening.

Code: Select all

 
 
            /* file listing text file for listing off uploads */
            $fileHandle = fopen("uploads/list.txt", 'a');
            $fileName = $_FILES["file"]["name"];
            fwrite($fileHandle, $fileName);
            fclose($fileHandle);
 

Re: fopen() and fwrite() not working

Posted: Tue Apr 14, 2009 7:57 am
by divito
Did the permissions happen to get reset?

Re: fopen() and fwrite() not working

Posted: Tue Apr 14, 2009 2:04 pm
by xplore
how do I do that ?

Re: fopen() and fwrite() not working

Posted: Tue Apr 14, 2009 9:03 pm
by McInfo
What operating system is your server using?

Edit: This post was recovered from search engine cache.

Re: fopen() and fwrite() not working

Posted: Wed Apr 15, 2009 4:06 pm
by xplore
This code doesn't even work on my local machine through localhost/

Re: fopen() and fwrite() not working

Posted: Wed Apr 15, 2009 6:11 pm
by McInfo
Then you server is localhost. What operating system are you using on localhost? The method for changing permissions is different for different operating systems. Permissions are just one possible cause of the problem, though.

Edit: This post was recovered from search engine cache.