desmond_ckl Posted September 2, 2011 Share Posted September 2, 2011 Hi there! im new to php , im having problem when upload image to server. Hope somebody can help me. i upload picture in admin CMS, the pic able to save in mysql but is not save in my server, the script below : $catImage = uploadImage('fleImage', SRV_ROOT . 'images/category/'); i have check the folder/directory name all correct but the picture wont save in my server images folder & i try this script but not working as well: $target_path = "images/category/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); i got this tutorial from : http://www.phpwebcommerce.com/ Thank You In Advance Quote Link to comment https://forums.phpfreaks.com/topic/246252-upload-image-to-server-help/ Share on other sites More sharing options...
voip03 Posted September 2, 2011 Share Posted September 2, 2011 Check your rights to upload image. $target_path = "images/category/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name'])." has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } Quote Link to comment https://forums.phpfreaks.com/topic/246252-upload-image-to-server-help/#findComment-1264638 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.