Here’s how to force the browser to download a file:
<?php
$file = "/path/to/foo.jpg";
$filename = basename($file);
header("Content-type: application/octet-stream");
header('Content-Disposition: attachment; filename="'.$filename.'";');
readfile($file);
exit;
?>