/** View a zooming image of the file * @access public * @return void * @throws Pas_Exception_Param */ public function zoomAction() { if ($this->getParam('id', false)) { $file = $this->_images->getFileName($this->getParam('id')); $this->view->data = $file; $this->view->path = $file[0]['f']; } else { throw new Pas_Exception_Param($this->_missingParameter, 404); } }
/** Download a file */ public function downloadAction() { if ($this->_getParam('id', false)) { $images = new Slides(); $download = $images->getFileName($this->_getParam('id')); foreach ($download as $d) { $filename = $d['f']; $path = $d['imagedir']; } $file = './' . $path . $filename; $mime_type = mime_content_type($file); if (file_exists($file)) { $this->_helper->viewRenderer->setNoRender(); $this->_helper->sendFile($file, $mime_type); } else { throw new Pas_Exception_Param('That file does not exist', 404); } } else { throw new Pas_Exception_Param($this->_missingParameter, 500); } }