예제 #1
0
 /**
  * @brief offer single file for download
  * 
  * @param string $path full path to file
  * @param int $id file id
  */
 public static function serveFile($path, $id)
 {
     \OCP\User::checkLoggedIn();
     \OC::$server->getSession()->close();
     Bookshelf::add($id);
     $dirName = dirname($path);
     $fileName = basename($path);
     \OC_Files::get($dirName, array($fileName), $_SERVER['REQUEST_METHOD'] == 'HEAD');
 }