public function showFile($projectId, $id) { $filePath = $this->service->getFilePath($id); $fileContent = file_get_contents($filePath); $file64 = base64_encode($fileContent); return ['file' => $file64, 'size' => filesize($filePath), 'name' => $this->service->getFileName($id), 'mime_type' => $this->service->getMimeType($id)]; }