koel/app/Http/Streamers/XSendFileStreamer.php
2016-08-03 18:42:11 +08:00

18 lines
445 B
PHP

<?php
namespace App\Http\Streamers;
class XSendFileStreamer extends Streamer implements StreamerInterface
{
/**
* Stream the current song using Apache's x_sendfile module.
*/
public function stream()
{
header("X-Sendfile: {$this->song->path}");
header("Content-Type: {$this->contentType}");
header('Content-Disposition: inline; filename="'.basename($this->song->path).'"');
exit;
}
}