Can not upload image to server
Posted: Sun Dec 09, 2007 7:27 am
I want to upload image to server by PHP but i get this error
/dodano is 777 permision but not working. Any idea why?
This is my code:Warning: move_uploaded_file(/home/turoglas/domains/turisticnioglasnik.si/public_html/dodano/223627514__.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/turoglas/domains/turisticnioglasnik.si/public_html/sistem/admin/slike.php on line 26
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpzzUB0V' to '/home/turoglas/domains/turisticnioglasnik.si/public_html/dodano/223627514__.jpg' in /home/turoglas/domains/turisticnioglasnik.si/public_html/sistem/admin/slike.php on line 26
Unknown image
Code: Select all
define('CMS_FIZICNA_POT', '/home/turoglas/domains/turisticnioglasnik.si/public_html');
$datoteka = basename($_FILES['file']['name']);
$datoteka = pocisti_datoteke($datoteka);
//$datoteka = rand() . '_' . $datoteka;
$slikovna_pot = CMS_FIZICNA_POT . '/dodano/';
$pot = $slikovna_pot . $datoteka;
if(file_exists($pot))
{
preusmeri_z_sporocilom('napaka', 'JEZIK_251', 'slike.php');
}
move_uploaded_file($_FILES['file']['tmp_name'], $pot);