/**
  * @NoAdminRequired
  */
 public function download($path)
 {
     if (!$path) {
         $response = new JSONResponse();
         $response->setStatus(Http::STATUS_BAD_REQUEST);
         return $response;
     }
     $fullPath = '/files' . $path;
     $fileInfo = \OC\Files\Filesystem::getFileInfo($path);
     if ($fileInfo) {
         if ($fileInfo->getMimeType() !== \OCA\Richdocuments\Filter\Office::NATIVE_MIMETYPE) {
             $file = new File($fileInfo->getId());
             $genesis = new Genesis($file);
             $fullPath = $genesis->getPath();
         }
     }
     return new DownloadResponse($this->request, $this->uid, $fullPath);
 }
Пример #2
0
 /**
  * @NoAdminRequired
  */
 public function download($path)
 {
     if (!$path) {
         $response = new JSONResponse();
         $response->setStatus(Http::STATUS_BAD_REQUEST);
         return $response;
     }
     $fullPath = '/files' . $path;
     $fileInfo = \OC\Files\Filesystem::getFileInfo($path);
     if ($fileInfo) {
         $file = new File($fileInfo->getId());
         $genesis = new Genesis($file);
         $fullPath = $genesis->getPath();
     }
     return new DownloadResponse($this->request, $this->uid, $fullPath);
 }