Это мой код:
public static function uploadProfileImage($filePath)
{
$target = $_SERVER['SERVER_ROOT']."/public/sources/profile/".
$_SESSION['uid']."_".basename($filePath);
if (move_uploaded_file($filePath, $target)) {
return true;
} else {
return false;
}
}
Я включил htaccess, и мой htacccess:
RewriteCond %{REQUEST_URI} !^/sources
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
Моя структура папок:
|
|--app (contains (MVC)
|--public (contains public index.php and .htaccess)
Сейчас, как написать путь для загрузки и где разместить папку загрузки для их сохранения