Koozali.org formerly Contribs.org

PHP file upload

brad wright

PHP file upload
« on: August 17, 2001, 09:45:11 AM »
Hi all,
Im trying to get a file upload script happening using PHP. The script i use is:

if ($upload_name != ""){
copy("$upload","/home/e-smith/files/ibays/project/files/uploads/$currentJobNo") or die ("couldnt copy the file");
 

}else{
die ("No file selected");
}


I get an error message that reads:
Warning: Unable to create '/home/e-smith/files/ibays/project/files/uploads/': Is a directory in /home/e-smith/files/ibays/project/html/users/addJob/addJob3.php on line 1
couldnt copy the file

I assume this is a write permission problem as I have read in a file upload tutorial that "the PHP user (the user under which PHP runs, ie "nobody" or "www" or "joe") must have write permissions ihn BOTH the temporary directory and the directory in which it is copying the file." (from THICKBOOK.COM)

If this is correct, what user does PHP run under. ie, what user should i set up under e-smith to allow PHP to copy files. OR is my code wrong somehow???

Hope this makes sense, and double hope one of you fine and helpful user can help.

Thanks in advance,
Brad