Whenever I try to move a file it does not work and shows “Image file not uploaded”… I just want to know where the error is…
$target = '/var/www/student/public/myimage.jpg';
$destination = '/var/www/student/public/images/myimage.jpg';
if( move_uploaded_file( $target, $destination ) ) {
echo "Image file is successfully loaded";
} else {
echo "Image file not uploaded.";
}
- I have checked error log (
tail -f /var/log/apache2/error.log) but found nothing. - target and destination both directories have 777 permissions.
Can someone tell me that how to find out the error. Any idea ?
If you are not using HTTP POST upload method then you can use
rename()