Witam, staram sie pobrac plik z youtube, splodzilem cos takiego :
header('Accept-Ranges: bytes', true);
header('Cache-control: private', true);
header('Pragma: private', true);
header('Content-type: video/flv', true);
header('Content-Length: '.$size, true);
header('Content-Disposition: inline; filename="'.$title.'.flv"', true);
@readfile($location);
przy czym $size - rozmiar pliku, pobierany z nagłówków
$location - bezpośredni adres do pliku .flv
Kod ten działa na Operze i FF 3. Natomiast w Chrome i IE7 skrypt ściąga pliki 0kb.
Stąd moje pytanie - co robie źle ? o_O
próbowałem modyfikować kod na np.
header("Cache-Control: private,max-age=3600");
header("Content-Description: File Transfer");
header("Content-Type: video/flv");
header('Content-Disposition: attachment; filename="'.$title.'.flv"',true);
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Transfer-Encoding: binary");
header('Content-Length: '. $size);
@readfile($location);
jednak to też nic nie daje, nadal działa tylko w Operze i FF, a IE7 / chrom zasysają pliki 0kb
Skrypty testuję na localhost, jednak po wrzuceniu na serwer nadal to samo - pliki 0kb w ie7/chrome :/