Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl


23kulpamens
Napisane: 23.09.2009, 11:35:11





Grupa: Zarejestrowani
Postów: 57
Dołączył: 11.10.2007

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

Tutaj masz przykład wysyłania pliku z php.net

kod wklej na początek skryptu, nie może być nawet spacji przed znacznikiem <?php

  1. <?php
  2. $file = 'monkey.gif';
  3.  
  4. if (file_exists($file)) {
  5. header('Content-Description: File Transfer');
  6. header('Content-Type: application/octet-stream');
  7. header('Content-Disposition: attachment; filename='.basename($file));
  8. header('Content-Transfer-Encoding: binary');
  9. header('Expires: 0');
  10. header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  11. header('Pragma: public');
  12. header('Content-Length: ' . filesize($file));
  13. flush();
  14. readfile($file);
  15. }
  16. ?>
  17.  
  Forum: PHP · Podgląd postu: #664091 · Odpowiedzi: 9 · Wyświetleń: 945


New Posts  Nowe odpowiedzi
No New Posts  Brak nowych odpowiedzi
Hot topic  Popularny temat (Nowe)
No new  Popularny temat (Brak nowych)
Poll  Sonda (Nowe)
No new votes  Sonda (Brak nowych)
Closed  Zamknięty temat
Moved  Przeniesiony temat
 

RSS Wersja Lo-Fi Aktualny czas: 24.04.2024 - 05:30