[fix] change dl method from PHP to webserver

This commit is contained in:
Knah Tsaeb 2013-07-29 12:09:30 +02:00
parent cd3c0c2d26
commit 7d00e3f4aa
2 changed files with 4 additions and 3 deletions

View File

@ -190,7 +190,7 @@ if ($ci['ac'] === 'view' && !empty($listCurrentFile)) {
</tr>
<tr>
<th>Download</th>
<td><a href="?bc=',$ci['bc'],'&amp;dl=',$videoInfo['hash'],'">Download</a></td>
<td><a href="',$path.$videoInfo['hash'], '.webm">Download</a></td>
</tr>
</table>
</div>';

View File

@ -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 ;
}