creating a file, uploading, and permissions

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
    I'm using php4 and i want to check for a file, if it doesn't exist it  
should be created. My problem is i have to create it with specific  
permissions specifically 666 so that the script can then write to it. I  
don't have ftp access. I'm also looking for any tutorials, recent ones,  
using php4 for creating file upload areas, i'm trying to make one of those  
as well.

Re: creating a file, uploading, and permissions

Dave wrote:
Quoted text here. Click to load it

// if file goes into a sub-directory from this file..

if(file_exists($filename) && is_writable($file)){
     // the file exists and is able to be written to
}else if(file_exists($file)){
     // file exists, but cannot be written to
}else if(is_writable(dirname($file))){
     // file does not exist, but can be created
     // file doesn't exist, nor can be created with current
     // permission mask on parent directory: dirname($file)


Justin Koivisto, ZCE -

Site Timeline