Exemple #1
0
 function GET(&$options)
 {
     global $bhsession;
     $fileexist = bh_user_file_exists($options['path']);
     if (!$fileexist) {
         return "404 Not found";
     }
     $fileobj = new bhfile($options['path']);
     $options['path'] = $options['path'];
     if ($fileobj->is_dir() == 1) {
         $options['mimetype'] = "directory";
     } else {
         $options['mimetype'] = $fileobj->mimetype();
     }
     $options['mtime'] = $fileobj->fileinfo['createdate'];
     $options['size'] = $fileobj->fileinfo['filesize'];
     $options['stream'] = $fileobj->filestream();
     return true;
 }