I save the downloaded files in a web directory:
public $path;
protected function getUploadRootDir()
{
return __DIR__.'/../../../../web/'.$this->getUploadDir();
}
protected function getUploadDir()
{
return 'uploads/documents';
}
Is this a good practice? Wouldn't it be better to save the downloaded files outside the web directory so that users cannot directly access them?
Do I think the best way is to save the downloaded files outside the root of the website? Where would it be better? Or how can I configure the web server to deny access to the uploads directory?
source
share