Do not check anymore data folder permissions
People who are using a remote database (Mysql/Postgresql) and a remote file storage (Aws S3 or similar) don't necessary needs to have a persistent local data folder or to change the permissions.
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace Api;
|
||||
|
||||
use Core\ObjectStorage\ObjectStorageException;
|
||||
|
||||
/**
|
||||
* File API controller
|
||||
*
|
||||
@@ -22,16 +24,17 @@ class File extends \Core\Base
|
||||
|
||||
public function downloadFile($file_id)
|
||||
{
|
||||
$file = $this->file->getById($file_id);
|
||||
try {
|
||||
|
||||
if (! empty($file)) {
|
||||
$file = $this->file->getById($file_id);
|
||||
|
||||
$filename = FILES_DIR.$file['path'];
|
||||
|
||||
if (file_exists($filename)) {
|
||||
return base64_encode(file_get_contents($filename));
|
||||
if (! empty($file)) {
|
||||
return base64_encode($this->objectStorage->get($file['path']));
|
||||
}
|
||||
}
|
||||
catch (ObjectStorageException $e) {
|
||||
$this->logger->error($e->getMessage());
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user