Hi, I am new to this forum, I have a open source website with php code and I am getting the below error when uploading image. Fatal error: Uncaught exception 'Exception' with message '/var/chroot/home/content/02/9689402/html/oc-content/uploads/119.jpg does not exist!' in /home/content/02/9689402/html/oc-includes/osclass/classes/ImageResizer.php:34 Stack trace: #0 /home/content/02/9689402/html/oc-includes/osclass/classes/ImageResizer.php(28): ImageResizer->__construct('/var/chroot/hom...') #1 /home/content/02/9689402/html/oc-includes/osclass/ItemActions.php(1273): ImageResizer::fromFile('/var/chroot/hom...') #2 /home/content/02/9689402/html/oc-includes/osclass/ItemActions.php(201): ItemActions->uploadItemResources(Array, 278) #3 /home/content/02/9689402/html/item.php(140): ItemActions->add() #4 /home/content/02/9689402/html/index.php(91): CWebItem->doModel() #5 {main} thrown in /home/content/02/9689402/html/oc-includes/osclass/classes/ImageResizer.php on line 34 Its a free classified website iclassads.com Thanks, satish
/var/chroot/home/content/02/9689402/html/oc-content/uploads/119.jpg Please check this path on your server to make sure that image exists? If it's an uploading script, maybe the uploading is failed or uploaded destination is incorrect so the script cannot resize your uploaded image.
Hi, Thanks for the reply, I have checked in ftp and the file does not exists. This error is getting while uploading image to the post. satish
make sure that you change permission of upload to writtable( like chmod 777 /var/chroot/home/content/02/9689402/html/oc-content/uploads) and try again?
Hi, On ftp i see /oc-content/uploads(I log-in with my host ip, username password). I do not see any /var/chroot. Thanks
it's normal if you can't see that /var/chroot/, normal ftp user doesn't have right to see that. -something wrong with your php code that won't allow image to be uploaded. Upload your code here. -false destination folder in upload settings? try to search for some upload destination setting and change it to the path above.
tRY THIS ONE <?php $target_path = "uploads/"; $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!"; } ?>
Don't be bloody ridiculous, whatever you do don't use this code without at least checking what type of file people are uploading, you will be hacked before you know it,