public function download() {
        // check if the file extension is allowed
        $this->validateExtension();       
        
        // download the file
        $this->downloadFile();
        
        // check the mime type for the file, if it is of the wrong type, unset the
        // file and throw the error on
        try {
            $this->validateFileType();
        } catch (Exception $exception) {
            // remove the file, the mime type is not allowed
            unlink($this->downloadFilePath());
            
            // throw the error on
            throw $exception;
        }

        // everything ok
        return true;
    }