/** * Sends a previously uploaded file if it exists. * * The first parameter can be set to the uploaded filename to force correct behaviour from the * browser regarding the filename. Otherwise the filename will be defined in the header and * becomes a little bit more unstable since cross-browser checks have to be made. */ public function downloadAction($parameter) { if (!$this->getFile()) { return 404; } if (count($parameter) > 1) { return 404; } if ($parameter && $parameter[0] != $this->filename) { return 404; } return Misc::servefile($this->file, $parameter ? FALSE : $this->filename); }