X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/5058cbd048a108666d4078c692cb12ce96e521db..d00ef4f1b8e503e29e10967f921c247a08670f61:/f.php?ds=sidebyside diff --git a/f.php b/f.php index e2547d7..f7f3786 100644 --- a/f.php +++ b/f.php @@ -272,11 +272,16 @@ elseif ($link['crypted']) { } /* Read file. */ else { - $r = fopen(VAR_FILES . $p . $link['hash'], 'r'); - while (!feof($r)) { - print fread($r, 1024); + if ($cfg['use_xsendfile']) { + $file_web_path = preg_replace('#^' . $_SERVER['DOCUMENT_ROOT'] . '#', '', VAR_FILES); + header('X-Sendfile: ' . $file_web_path . $p . $link['hash']); + } else { + $r = fopen(VAR_FILES . $p . $link['hash'], 'r'); + while (!feof($r)) { + print fread($r, 1024); + } + fclose($r); } - fclose($r); } if ($link['onetime'] == 'O') {