Automatyczne pobieranie pliku (download pliku) 
Skrypt pobiera plik z serwera poprzez funkcję header, jest to często stosowane np na dobreprogramy.pl
Listing
<?PHP
$filePath = "nazwa katalogu"; // np: pliki/
$fileName = "nazwa pliku"; // np. program.exe
$fd = fopen($filePath.$fileName,"r");
$size = filesize($filePath.$fileName);
$contents = fread($fd, filesize($filePath.$fileName));
fclose($fd);
header("Content-Type: application/octet-stream");
header("Content-Length: $size;");
header("Content-Disposition: attachment; filename=$fileName");
echo $contents;
?>
Dodano przez: igor  
Ranga: Administrator serwisu Punktów: 0
Ranga: Administrator serwisu Punktów: 0
Komentarze użytkowników
:: Losowe artykuły 

:: Wymiana linków 
    
	Modowe inspiracje |
        Android Gry i Aplikacje |
        ZaplanujTransport.pl: Przeprowadzki, transport, aukcje |
        Logo dla firmy |
        Change Tires - Car Weather Forecast Reminder |
        Laminas: MVC Framework for PHP |
        IT Books Reviews and Programming: JS, JAVA, PHP, ANDROID, CSS | 
        Katalog roślin |
        Programming articles: JAVA, PHP, C++, Python, JavaScript |
        Kancelaria Adwokacka Łukasz Huszno
        
    

 
  
				

 
                             
 


 
                        
 
		 
	