Dziękuję za szybką odpowiedź. Nie wiem czy dobrze zaimplementowałem, ale dla rnd:
<?php
$file = "/katalog/poza/public-html/".$_GET["file"].'.mp3' . '?rnd=' . mt_rand(); $mm_type = "application/octet-stream";
{
header("Cache-Control: no-store, no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Content-Type: " . $mm_type); }
?>
serwer generalnie szaleje dostaje w logach:
[error] [client xxx.xxx.xxx.xxx] PHP Warning: fread() expects parameter 1 to be resource, boolean given in skrypt-1.php on line 13
[error] [client xxx.xxx.xxx.xxx] PHP Warning: feof() expects parameter 1 to be resource, boolean given in skrypt-1.php on line 5
[error] [client xxx.xxx.xxx.xxx] PHP Warning: filesize(): stat failed for /katalog/poza/public_html/demo.mp3?rnd=1511147903 in skrypt-1.php on line 12
[error] [client xxx.xxx.xxx.xxx] PHP Warning: filesize(): stat failed for /katalog/poza/public_html/demo.mp3?rnd=1511147903 in skrypt-1.php on line 13
[error] [client xxx.xxx.xxx.xxx] PHP Warning: fread() expects parameter 1 to be resource, boolean given in skrypt-1.php on line 13
[error] [client xxx.xxx.xxx.xxx] PHP Warning: feof() expects parameter 1 to be resource, boolean given in skrypt-1.php on line 5
itd...
dla md5
<?php
$file = "/katalog/poza/public_html/".$_GET["file"].'.mp3';
$file .= '?md5=" . md5_file($file);$fh = fopen($file,"rb");
$mm_type = "application/octet-stream";
while (!feof($fh))
{
header('Location: '.$file);
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Pragma: hack");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Content-Type: " . $mm_type);
header('Content-Length: ' . filesize($file));
print(fread($fh, filesize($file)));
}
fclose($fh);
?>
w logach:
[error] [client xxx.xxx.xxx.xxx] PHP Parse error: syntax error, unexpected T_STRING in skrypt-2.php on line 7
Testowałem już header'y. Niestety z Operą nic nie działa.
Pozdrawiam