hi everyone !

im currently trying to upload a image with a form to my webserver, the only problem i find is , the php sends me a error saying

Warning: rename(photo/,okokok.jpg): Permission denied in /home/website/public_html/photos/photo.php on line 49

and i already setup permission 777 to the folder :mad:

im currently using this code that takes the foto, renames it and the uploads it

if anyone knows of a better code to do this, plz tell me ! !

		$uploaddir = 'fotos/';
		$uploadfile = $uploaddir . basename($_FILES['imagen']['name']);
		$renamed = $evnt . $phile . ".jpg";

if (move_uploaded_file($_FILES['imagen']['tmp_name'], $uploadfile)) 
{
   $ok = "La foto es correcta y fue subida.\n";
} 
else 
{
   $error[] = "Posible ataque, cuidado con lo que haces!\n";
}

rename($uploadfile, $renamed);

    it doesnt look like youre getting the filename correctly, as its complaining about you trying to remane 'photo/' which is the directory without the filename

    perhaps the line

    $uploadfile = $uploaddir . basename($_FILES['imagen']['name']);

    should read

    $uploadfile = $uploaddir . basename($_FILES['imagen']['tmp_name']);

    ?

      thx for ur reply

      so far, i till get this error

      Warning: rename(photos/,6ok.jpg): Permission denied in /home/webserver/public_html/site/photo.php on line 49
      
        Write a Reply...