<?php
$file = 'http://www.liens-vers-mon-image.php';
header('Content-Type: application/force-download');
header('Content-Disposition: attachment; filename='.basename($file));
readfile($file);
?>
$quoted = sprintf('"%s"', addcslashes(basename($file), '"\\')); $size = filesize($file); header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=' . $quoted); header('Content-Transfer-Encoding: binary'); header('Connection: Keep-Alive'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . $size);
<?php
$file = '/home/xxxx/www/xxx/img.php';
$quoted = sprintf('"%s"', addcslashes(basename($file), '"\\'));
$size = filesize($file);
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . $quoted);
header('Content-Transfer-Encoding: binary');
header('Connection: Keep-Alive');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . $size);
?>
<?php error_reporting(E_ALL); ini_set('display-errors','on'); $file = '8pool.php'; if(!file_exists($file)){ die('fichier introuvable !'); } if(!is_readable($file)){ die ('Impossible de lire le fichier'); } $quoted = sprintf('"%s"', addcslashes(basename($file), '"\\')); $size = filesize($file); header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=' . $quoted); header('Content-Transfer-Encoding: binary'); header('Connection: Keep-Alive'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . $size); //petit oubli de la dernière ligne : echo file_get_contents($file); ?>
echo file_get_contents($file);