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