<?php
$file_path = "./1.mp4"; //视频文件地址
ob_end_clean();
ob_start();
//打开文件
$handler = fopen($file_path, 'rb');
$file_size = filesize($file_path);
//声明头信息
Header("Content-type: application/octet-stream");
Header("Accept-Ranges: bytes");
Header("Accept-Length: " . $file_size);
Header("Content-Disposition: attachment; filename=" . basename($file_path));
// 输出文件内容
$oct_data = fread($handler, $file_size);
fclose($handler);
ob_end_flush();

return $oct_data;
