Files
mtdb_movie/common/Files/Response/XSendFileResponse.php
maher 703f50a09d
Some checks failed
Build / run (push) Has been cancelled
first commit
2025-10-29 11:42:25 +01:00

24 lines
630 B
PHP
Executable File

<?php
namespace Common\Files\Response;
use Common\Files\FileEntry;
class XSendFileResponse implements FileResponse
{
/**
* @param FileEntry $entry
* @param array $options
* @return mixed
*/
public function make(FileEntry $entry, $options)
{
$path = storage_path('app/uploads').'/'.$entry->getStoragePath($options['useThumbnail']);
$disposition = $options['disposition'];
header("X-Sendfile: $path");
header("Content-Type: {$entry->mime}");
header("Content-Disposition: $disposition; filename=\"".$entry->getNameWithExtension().'"');
exit;
}
}