Jump to content

Help with Rename/Copy statments


bizerk

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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.