groups

name language licence
PHP/MYSQL : Notes mysqli PHP Other
PHP/MYSQL : Chaines de caractères echapper avant insertion en base PHP Other
Untitled Snippet Other Other
PHP/MYSQL/SQL : inserer donnees en base depuis csv PHP Other
PHP/JS : ternaire PHP Other
PHP/JS : utilisation de la classe Ajax_upload Other Other
PHP : isset checkbox avant de le mettre dans une variable Other Other
PHP : forcer telechargement d'un fichier PHP Other

< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 >



language: PHP
licence: Other

PHP : forcer telechargement d'un fichier

options: view full snippetsend to code collector
/*la page download.php*/

<?php

$chemin = $_GET['ch'];

header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($chemin));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');

/*nettoyage des tampon de sortie*/
	
(Continues...)