We posted web development guide with the information on how to save remote images from the web using PHP, and one of the web developers asked us a question on how you can allow people to download the image without saving it on the server, and here is the answer to this question.
Here is the link to the previous post: http://superiorwebsys.com/84-php-how-to-save-image-from-web-remote-image/
Here is the very simple code that will allow you to do so:
<?
$remoteFile='http://chart.apis.google.com/chart?chs=150x150&cht=qr&chld=L|0&chl=http://superiorwebsys.com';
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=\"QR.jpg\";" );
header("Content-Transfer-Encoding: binary");
readfile($remoteFile);
?>
Click here to run thgis code
In place of $remoteFile you can put a link to any file and this script will force user browser to offer downloading of the content instead of opening it .