esto lo pondrías el el php
el $_GET['file']; es la variable que tiene el nombre de la imagen   
 Código PHP:
     
$f= $_GET['file'];
 
header("Content-type: application/octet-stream");
    header("Content-Disposition: attachment; filename=\"$f\"\n");
    $fp=fopen("$f", "r");
    fpassthru($fp);
       
    header("Location: ../index.php?error=$cantidad"); 
    
  nota este es un ecript básico y no posee seguridad en cuanto a proteger archivos tenlo en cuenta si quieres proteger archivos tendrias que poner algunas cosas adicionales pero eso es otro tema XDXD