phpnoobie9 Posted April 4, 2008 Share Posted April 4, 2008 I'm trying to get image2 to have the same name as the first image but be placed in a different directory. I can get the first image to upload and have the name be md5 randomly, but can't get the second image to upload. //Directory paths $absolutepath = ABSOLUTE_PATH; $absolutepath2 = ABSOLUTE_PATH2; echo "Main 150x150 screenshot path: ".$absolutepath."<br /> Secondary 200x200 screenshot path: ".$absolutepath2; //Start image upload //Check for an image $newname = md5(time()*rand(1,99999).$_FILES['image']['name']); $newname2 = $newname.'.jpg'; if (move_uploaded_file ($_FILES['image']['tmp_name'], ABSOLUTE_PATH."$newname2")) { echo '<p>Image uploaded</p>'; } else { echo '<p>Problem uploading image</p>'; } //Check for image2 if (move_uploaded_file ($_FILES['image']['tmp_name'], ABSOLUTE_PATH2."$newname2")) { echo '<p>Image2 uploaded</p>'; } else { echo '<p>Problem uploading image2</p>'; } Link to comment https://forums.phpfreaks.com/topic/99604-need-some-help-with-file-upload/ Share on other sites More sharing options...
phpnoobie9 Posted April 4, 2008 Author Share Posted April 4, 2008 Got it...missed the name on $_FILES. Thanks for looking. Link to comment https://forums.phpfreaks.com/topic/99604-need-some-help-with-file-upload/#findComment-509565 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.