Add new constants: FILES_DIR and DEBUG_FILE
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace Controller;
|
||||
|
||||
use Model\File as FileModel;
|
||||
|
||||
/**
|
||||
* File controller
|
||||
*
|
||||
@@ -54,7 +52,7 @@ class File extends Base
|
||||
{
|
||||
$task = $this->getTask();
|
||||
$file = $this->file->getById($this->request->getIntegerParam('file_id'));
|
||||
$filename = FileModel::BASE_PATH.$file['path'];
|
||||
$filename = FILES_DIR.$file['path'];
|
||||
|
||||
if ($file['task_id'] == $task['id'] && file_exists($filename)) {
|
||||
$this->response->forceDownload($file['name']);
|
||||
@@ -91,7 +89,7 @@ class File extends Base
|
||||
{
|
||||
$task = $this->getTask();
|
||||
$file = $this->file->getById($this->request->getIntegerParam('file_id'));
|
||||
$filename = FileModel::BASE_PATH.$file['path'];
|
||||
$filename = FILES_DIR.$file['path'];
|
||||
|
||||
if ($file['task_id'] == $task['id'] && file_exists($filename)) {
|
||||
$metadata = getimagesize($filename);
|
||||
|
||||
Reference in New Issue
Block a user