[fix] change dl method from PHP to webserver
This commit is contained in:
parent
cd3c0c2d26
commit
7d00e3f4aa
|
@ -190,7 +190,7 @@ if ($ci['ac'] === 'view' && !empty($listCurrentFile)) {
|
|||
</tr>
|
||||
<tr>
|
||||
<th>Download</th>
|
||||
<td><a href="?bc=',$ci['bc'],'&dl=',$videoInfo['hash'],'">Download</a></td>
|
||||
<td><a href="',$path.$videoInfo['hash'], '.webm">Download</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>';
|
||||
|
|
|
@ -103,6 +103,7 @@ function sendVideo($bc, $file) {
|
|||
global $fullListFile;
|
||||
$path = chunk_split($bc, 8, '/');
|
||||
$fileName = html_entity_decode($fullListFile[$file]['title']);
|
||||
$fileSize = filesize($GLOBALS['config']['VIDEODIR'].'/'.$path.$file.'.webm');
|
||||
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: application/octet-stream');
|
||||
|
@ -111,10 +112,10 @@ function sendVideo($bc, $file) {
|
|||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate');
|
||||
header('Pragma: public');
|
||||
header('Content-Length: '.filesize($GLOBALS['config']['VIDEODIR'].'/'.$path.$file.'.webm'));
|
||||
header('Content-Length: '.$fileSize);
|
||||
ob_clean();
|
||||
flush();
|
||||
readfile($path.$file);
|
||||
readfile($GLOBALS['config']['VIDEODIR'].'/'.$path.$file.'.webm');
|
||||
exit ;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue