Initial import
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var \app\models\RegisterObjectFiles $objectFile */
|
||||
|
||||
if (!empty($_GET['preview']) && $_GET['preview'] == 'pdf') {
|
||||
$file = $objectFile->file_url;
|
||||
$filename = $objectFile->video_title ?? 'PDF файл';
|
||||
header('Content-type: application/pdf');
|
||||
header('Content-Disposition: inline; filename="' . $filename . '"');
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
header('Accept-Ranges: bytes');
|
||||
@readfile($file);
|
||||
exit;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user