tomtimms216 Posted February 8, 2013 Share Posted February 8, 2013 I am trying to upload an image from a form however it keeps saving with the image name twice. move_uploaded_file($_FILES["artwork_1_image"]["tmp_name"],$target_path . $artist_last_name . '_1_' . $_FILES["artwork_1_image"]["name"]); my image name is boston_smiley.jpg, so I want to store it in my directory with a prefix variable $artist_lastname_1_{{ the file name }}. What I am getting is boston_smiley.jpgJohnson_1_boston_smiley.jpg instead of Johnson_1_boston_smiley.jpg anyone know what's the deal! Quote Link to comment https://forums.phpfreaks.com/topic/274225-move_uploaded_file-function-issue/ Share on other sites More sharing options...
denno020 Posted February 8, 2013 Share Posted February 8, 2013 I reckon that boston_smiley.jpg is still on the end of $target_path. Just echo $target_path, so you can see what it actually is. Denno Quote Link to comment https://forums.phpfreaks.com/topic/274225-move_uploaded_file-function-issue/#findComment-1411171 Share on other sites More sharing options...
tomtimms216 Posted February 9, 2013 Author Share Posted February 9, 2013 Thanks denno020, I forgot that i was appending to the variable up in my code and forgot to remove it. Thanks for the time. Quote Link to comment https://forums.phpfreaks.com/topic/274225-move_uploaded_file-function-issue/#findComment-1411208 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.