X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/8665ea5fc150ca65125f24023b545fe39bdb2a95..689557880514b74d0e21a56b40fe16a78f3b1a65:/f.php 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') {