check uploaded files for existance (UploadsController)
This commit is contained in:
parent
c354ed3f7f
commit
2ec13fa516
1 changed files with 5 additions and 0 deletions
|
|
@ -208,6 +208,11 @@
|
|||
|
||||
// Set content-type
|
||||
$this->response->addHeader("Content-type: image/jpeg");
|
||||
|
||||
// Check file
|
||||
if(!file_exists($upload['filename'])) {
|
||||
throw new \nre\exceptions\IdNotFoundException($upload['url']);
|
||||
}
|
||||
|
||||
// Cache
|
||||
if($this->setCacheHeaders($upload['filename'])) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue