Do you want to open the image in a new window / tab? Or do you want to download it to the user's computer? If you want the user to save the image, you need to set the content type of the resulting file:
<?php
$file = $_GET['file'];
header("Content-Type: application/octet-stream; ");
header("Content-Transfer-Encoding: binary");
header('Content-Disposition: attachment; filename="'.basename($file).'"');
readfile($file);
?>
Be sure to check the login so that users cannot download the source files.
source
share