Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Skrypt nie wysyła headera Content-Length . apache2, Pobieranie pliku bez rozmiaru
NeronRS
post
Post #1





Grupa: Zarejestrowani
Postów: 48
Pomógł: 0
Dołączył: 17.06.2008
Skąd: Lasowice

Ostrzeżenie: (0%)
-----


Witam, moim problemem jest to, że skrypt w ogóle nie wysyła do przeglądarek Content-Length

Napisałem najprostszy skrypt na potrzeby forum i w obawie, że problem może leżeć gdzie indziej:

  1. <?php
  2. $fichero = 'mp3.mp3';
  3.  
  4. if (file_exists($fichero)) {
  5. header('Content-Description: File Transfer');
  6. header('Content-Type: audio/mpeg');
  7. header('Content-Disposition: attachment; filename='.basename($fichero));
  8. header('Content-Transfer-Encoding: binary');
  9. header('Expires: 0');
  10. header('Cache-Control: must-revalidate');
  11. header('Pragma: public');
  12. header('Content-Length: ' . filesize($fichero));
  13. flush();
  14. readfile($fichero);
  15. }
  16. ?>


Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 13:48