НА сайте есть форма
<form name="upload" action="#" method="POST" ENCTYPE="multipart/form-data">
Select the file to upload: <input type="file" name="userfile">
<input type="submit" name="upload" value="upload">
</form>
Вот php код
<?php
$uploaddir = '../media/images/'; // Relative path under webroot
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "File uploading failed.\n";
}
?>
На локалке все норм работает. А на хосте вылазит ошибка
Warning: move_uploaded_file(../media/images/46981.jpg): failed to open stream: Permission denied in www.domen.ru/inf/add.php on line 106
Warning: move_uploaded_file(): Unable to move '/tmp/php88Nltc' to '../media/images/46981.jpg' in www.domen.ru/inf/add.php on line 106