Jump to content

Archived

This topic is now archived and is closed to further replies.

bizerk

Help with Rename/Copy statments

Recommended Posts

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:

[code]$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);[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.