当前位置: 首页>>代码示例>>PHP>>正文


PHP filesystem::chroot_filesize方法代码示例

本文整理汇总了PHP中filesystem::chroot_filesize方法的典型用法代码示例。如果您正苦于以下问题:PHP filesystem::chroot_filesize方法的具体用法?PHP filesystem::chroot_filesize怎么用?PHP filesystem::chroot_filesize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在filesystem的用法示例。


在下文中一共展示了filesystem::chroot_filesize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 case 'mail_files':
     $_SESSION['attach_array'] = array();
     $_SESSION['num_attach'] = 0;
     require $email_module['class_path'] . "email.class.inc";
     $email = new email();
     if (isset($_POST['files'])) {
         while ($file = smartstrip(array_shift($_POST['files']))) {
             if ($fs->has_read_permission2($GO_SECURITY->user_id, $file)) {
                 $tmp_file = $GO_CONFIG->tmpdir . md5(uniqid(time()));
                 if ($fs->chroot_copy_r2($file, $tmp_file)) {
                     $filename = basename($file);
                     $extension = get_extension($filename);
                     if (!($type = $filetypes->get_type($extension))) {
                         $type = $filetypes->add_type($extension);
                     }
                     $email->register_attachment($tmp_file, $filename, $fs->chroot_filesize($file), $type['mime']);
                 }
             } else {
                 $popup_feedback .= access_denied_box(basename($file));
             }
         }
         echo '<script type="text/javascript" language="javascript">';
         echo 'popup("' . $email_module['url'] . 'send.php?email_file=true","' . $GO_CONFIG->composer_width . '","' . $GO_CONFIG->composer_height . '");';
         echo '</script>';
     }
     require 'listview.inc';
     break;
 case 'delete':
     if (isset($_POST['files'])) {
         for ($i = 0; $i < count($_POST['files']); $i++) {
             $file = smartstrip($_POST['files'][$i]);
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:31,代码来源:index.php

示例2: filesystem

$GO_SECURITY->authenticate();
$GO_MODULES->authenticate('filesystem');
require $GO_CONFIG->class_path . 'filetypes.class.inc';
require_once $GO_CONFIG->class_path . 'filesystem.class.inc';
require_once 'group_folders.inc';
$fs = new filesystem();
$filetypes = new filetypes();
$path = smartstrip($_REQUEST['path']);
$group_folders = get_group_folders($GO_SECURITY->user_id, 0);
if (is_group_folder($group_folders, $path) || $fs->has_read_permission($GO_SECURITY->user_id, $path) || $fs->has_write_permission($GO_SECURITY->user_id, $path)) {
    $filename = basename($path);
    $extension = get_extension($filename);
    $type = $filetypes->get_type($extension);
    $browser = detect_browser();
    header('Content-Type: ' . $type['mime']);
    header('Content-Length: ' . $fs->chroot_filesize($path));
    header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
    if ($browser['name'] == 'MSIE') {
        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment; filename="' . $filename . '"');
        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
        header('Pragma: public');
    } else {
        header('Content-Type: ' . $type['mime']);
        header('Pragma: no-cache');
        header('Content-Disposition: attachment; filename="' . $filename . '"');
    }
    header('Content-Transfer-Encoding: binary');
    $fd = $fs->chroot_fopen($path, 'rb');
    while (!feof($fd)) {
        print fread($fd, 32768);
开发者ID:BackupTheBerlios,项目名称:hpt-obm-svn,代码行数:31,代码来源:download.php


注:本文中的filesystem::chroot_filesize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。