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)];
 }
コード例 #2
0
 public function showFile($id, $idFile)
 {
     $filePath = $this->service->getFilePath($idFile);
     $fileContent = file_get_contents($filePath);
     $file64 = base64_encode($fileContent);
     return ['file' => $file64, 'size' => filesize($filePath), 'name' => $this->service->getFileName($idFile)];
 }
コード例 #3
0
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function showFile($id, $idFile)
 {
     $model = $this->repository->skipPresenter()->find($idFile);
     $filePath = $this->service->getFilePath($idFile);
     $fileContent = file_get_contents($filePath);
     $file64 = base64_encode($fileContent);
     return ['file' => $file64, 'size' => filesize($filePath), 'name' => $this->service->getFileName($idFile), 'mime_type' => $this->storage->mimeType($model->getFileName())];
 }
コード例 #4
0
 public function showFile($id)
 {
     if (!$this->service->checkProjectPermissions($id)) {
         return $this->erroMsgm("O usuário não tem acesso a esse projeto");
     }
     $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)];
 }
コード例 #5
0
 public function showFile($id)
 {
     if ($this->service->checkProjectPermissions($id) == false) {
         return ['error' => 'Access Forbidden'];
     }
     $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)];
 }
コード例 #6
0
 public function showFile($id, $idFile)
 {
     //if($this->service->checkProjectPermissions($id) == false){
     //    return ['error' => 'Access Forbidden'];
     //}
     $filePath = $this->service->getFilePath($idFile);
     $fileContent = file_get_contents($filePath);
     $file64 = base64_encode($fileContent);
     return ['file' => $file64, 'size' => filesize($filePath), 'name' => $this->service->getFileName($idFile)];
     //return response()->download($this->service->getFilePath($id));
 }
コード例 #7
0
 public function showFile($id, $idFile)
 {
     if ($this->projectService->checkProjectPermissions($id) == false) {
         return ['error' => 'Access Forbidden'];
     }
     $model = $this->repository->skipPresenter()->find($idFile);
     $filePath = $this->service->getFilePath($idFile);
     $fileContent = file_get_contents($filePath);
     $file64 = base64_encode($fileContent);
     return ['file' => $file64, 'size' => filesize($filePath), 'name' => $this->service->getFileName($idFile), 'mime_type' => $this->storage->mimeType($model->getFileName())];
 }