diff --git a/board.php b/board.php index fdab032..9fae150 100644 --- a/board.php +++ b/board.php @@ -66,8 +66,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } else { $uploadDir = $config['upload_path']; if (!is_dir($uploadDir)) { - mkdir($uploadDir, 0755, true); + mkdir($uploadDir, 0777, true); } + chmod($uploadDir, 0777); $fileName = $postId . '.' . $fileExt; $filePath = $uploadDir . $fileName; @@ -76,7 +77,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $fileSize = $file['size']; $fileType = $fileExt; } else { - $error = 'Ошибка загрузки файла: ' . error_get_last()['message']; + $error = 'Ошибка загрузки файла'; } } } diff --git a/newthread.php b/newthread.php index 7bf6b91..f192470 100644 --- a/newthread.php +++ b/newthread.php @@ -74,8 +74,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } else { $uploadDir = $config['upload_path']; if (!is_dir($uploadDir)) { - mkdir($uploadDir, 0755, true); + mkdir($uploadDir, 0777, true); } + chmod($uploadDir, 0777); $fileName = $threadId . '.' . $fileExt; $filePath = $uploadDir . $fileName; @@ -84,7 +85,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $fileSize = $file['size']; $fileType = $fileExt; } else { - $error = 'Ошибка загрузки файла: ' . error_get_last()['message']; + $error = 'Ошибка загрузки файла'; } } }