rename() getting permission denied error
Posted: Sat May 27, 2006 11:49 am
Hello,
I'm having an interesting problem with some file upload issues.
I am uploading photos into a directory w/ 777 permissions and right after the photo is uploaded into the directory, I user the chmod command to set the permissions of the uploaded photo to 777 as well. Then I try to use the rename command to change the name of the photo and I get a permission denied error.
Here's the code I'm using:
Completely weird,
Any ideas?
I'm having an interesting problem with some file upload issues.
I am uploading photos into a directory w/ 777 permissions and right after the photo is uploaded into the directory, I user the chmod command to set the permissions of the uploaded photo to 777 as well. Then I try to use the rename command to change the name of the photo and I get a permission denied error.
Here's the code I'm using:
Code: Select all
$new_thumbnail_name = $catalogue_id . '_tn_' . $item_thumbnail_path;
if( file_exists( "../../uploaded_gallery_photos/$item_thumbnail_path" ) ){ echo "<br>YESS!!!!!"; }else{ echo "<br> NO!!!!!"; } //for testing purposes - this alway reports that the file exists
rename( "../../uploaded_gallery_photos/$tem_thumbnail_path", $new_thumbnail_name );Any ideas?