public function download($id = null, $file = null) {
		$type = $this->_controller->RequestHandler->prefers();
		$exportFileName = null;
		if (method_exists($this->_model, 'getExportFilename')) {
			$exportFileName = $this->_model->getExportFilename($id, true);
		}

		$exportPath = $this->_getExportDir();
		$downloadFile = $exportPath . $file;
		if (!empty($type)) {
			$downloadFile .= '.' . $type;
		}

		if (!file_exists($downloadFile)) {
			throw new InternalErrorException(__d('view_extension', 'Invalid file for downloading'));
		}

		if (!empty($type) && !empty($exportFileName)) {
			$this->_controller->response->type($type);
			$exportFileName .= '.' . $type;
		}
		$responseOpt = [
			'download' => true,
		];
		if (!empty($exportFileName)) {
			if ($this->_controller->request->is('msie')) {
				$exportFileName = rawurlencode($exportFileName);
			}
			$responseOpt['name'] = $exportFileName;
		}
		$this->_controller->response->file($downloadFile, $responseOpt);

		return $this->_controller->response;
	}