Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Wysylanie naglowka header()
webmaestro
post
Post #1





Grupa: Zarejestrowani
Postów: 48
Pomógł: 0
Dołączył: 25.12.2009

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


  1. <?
  2. $filePath ="a/";
  3. $fileName="a.zip";
  4. $fd = fopen($filePath.$fileName,"r");
  5. $size = filesize($filePath.$fileName);
  6. $contents = fread($fd, filesize($filePath.$fileName));
  7.  
  8. fclose($fd);
  9.  
  10. header("Content-Type: application/octet-stream");
  11. header("Content-Length: $size;");
  12. header("Content-Disposition: attachment; filename=$fileName");
  13.  
  14. echo $contents;
  15. ?>


Mam taki kod. Nie wysyła mi nagłowek wagi pliku, co zle zrobilem??
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
ActivePlayer
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 1 224
Pomógł: 40
Dołączył: 6.07.2004
Skąd: Wuppertal

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


a bez headerów i echo $content, samo echo $size co pokazuje?
Go to the top of the page
+Quote Post
webmaestro
post
Post #3





Grupa: Zarejestrowani
Postów: 48
Pomógł: 0
Dołączył: 25.12.2009

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


Bo na innym serwerze dziala a na linuxpl.com nie dziala ten header z waga pliku. Wina chmodow czy czego moze byc?(IMG:style_emoticons/default/questionmark.gif)
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 20.09.2025 - 15:20