mirror of
https://github.com/koel/koel
synced 2024-11-27 22:40:26 +00:00
18 lines
433 B
PHP
18 lines
433 B
PHP
<?php
|
|
|
|
namespace App\Services\Streamers;
|
|
|
|
class XSendFileStreamer extends LocalStreamer
|
|
{
|
|
/**
|
|
* Stream the current song using Apache's x_sendfile module.
|
|
*/
|
|
public function stream(): void
|
|
{
|
|
header("X-Sendfile: {$this->song->path}");
|
|
header("Content-Type: $this->contentType");
|
|
header('Content-Disposition: inline; filename="' . basename($this->song->path) . '"');
|
|
|
|
exit;
|
|
}
|
|
}
|