I am facing uploading problem in php script. I have two users:
- joseph
- joe
Both users have the same privileges and can upload the images. The problem I am facing is, that user "joseph" can upload the images while "joe" can not. I have gone through the script line by line and have echo(d) the results line by line for both users and have seen that the problem occurs at the
rename($path_to_image, $uploaded_pic)
function. For "joseph" the file/dir is renamed but for "joe" it does not. Again I say that both the users are registered users and have the same privileges. Can someone please help me? Here is the code:
// Create path for final location.
$uploaded_pic = $dest_dir . $picture_name;
// Form path to temporary image.
$path_to_image = './'.$CONFIG['fullpath'].'edit/'.$file_set[1];
// prevent moving the edit directory...
if (is_dir($path_to_image))
cpg_die(CRITICAL_ERROR, $lang_upload_php['failure'] . " - '$path_to_image'", __FILE__, __LINE__, true);
echo "path to imnage: ".$path_to_image;
echo "uploaded pic: ".$uploaded_pic;
echo "entreing rename function";
/* same results are echo(ed) for both user till here. But below this only "joseph" can enter successfully, not "joe"*/
//Move the picture into its final location
if (rename($path_to_image, $uploaded_pic)) {
echo "in rename";
exit;
Thanks
jBashir