Jump to content


Photo

Help with Rename/Copy statments


  • Please log in to reply
No replies to this topic

#1 bizerk

bizerk
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts

Posted 01 October 2006 - 02:56 AM

Well first off i am trying to make a type of image uploader where when uploaded it stores into a variable called which file, and than is renamed into a folder called PUBLIC with the extension at the end and everything. The script works with this but i am trying to back it up into each user's SPECIFIC folder as well. If i replace the two in the first rename it will work, but it's when i try to COPY the image and than RENAME it again is where it screws up. here is the code snippet:

$public = "users/public";
				rename($user_dat['usrdir'] . "/" . $_FILES[$whichfile]['name'], $public . "/" . $split_img[0] . "." . strtolower($split_img[1]));
				copy($_FILES[$whichfile]['tmp_name'], $user_dat['usrdir'] . "/" . $_FILES[$whichfile]['name']), $lol . "/" . $split_img[0] . "." . strtolower($split_img[1]));
				rename($lol . "/" . $split_img[0] . "." . strtolower($split_img[1])), $user_dat['usrdir'] . "/" . $split_img[0] . "." . strtolower($split_img[1]));
				 chmod($public . "/" . $split_img[0] . "." . strtolower($split_img[1])), 0644);
				 chmod($user_dat['usrdir'] . "/" . $split_img[0] . "." . strtolower($split_img[1])), 0644);





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users