noramosquito
New Member
I am displaying the images through the Apache server. When I click on each image it should open \[code\]download.php?fiel=file_name.jpg\[/code\] and download the image to the system.This is the code for Image Display\[code\] <?php $files = glob("Image/"."*.*"); for ($i=0; $i<count($files); $i++){$num = $files[$i];echo $num."<br>";echo '<img src="'.$num.'" alt="Here should be image" width="256" height="192" >'."<br/>";}?>\[/code\]I used the following code to download the Image (i.e download.php file).\[code\] <?php $file = $_GET['file']; header("Content-type: image"); header("Content-disposition: attachment; filename= ".$file.""); readfile($file); ?> \[/code\]How to achieve this?