check uploaded files for existance (UploadsController)

This commit is contained in:
coderkun 2014-07-11 12:21:58 +02:00
commit 2ec13fa516

View file

@ -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'])) {