예제 #1
0
 protected function pub_get()
 {
     if ($file = $this->get_file($this->args['id'])) {
         header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT');
         header('Cache-Control: no-cache, must-revalidate');
         // HTTP/1.1
         header('Pragma: no-cache');
         // HTTP/1.0
         header('Accept-Ranges: bytes');
         header('Content-Length: ' . $file->size);
         header('Connection: close');
         header('Content-Type: ' . $file->type . '; charset=' . CHARSET);
         if (isset($this->args['download'])) {
             header('Content-Disposition: attachment; filename="' . $file->name . '"');
         }
         file_system::file_content($file->real_name);
     } else {
         header("HTTP/1.0 404 Not Found");
     }
 }