
01/03/2006, 11:46
|
| | Fecha de Ingreso: abril-2005
Mensajes: 55
Antigüedad: 20 años Puntos: 2 | |
Descargar imagen con un click Bien, el enlace sería una cosa así:
<a href="bajando.php?id=imagen.jpg"><img src="images/imagen.jpg" ></a>
y el archivo bajando.php contendría lo siguiente:
<?php
$enlace = "images/".$id;
header ("Content-Disposition: attachment; filename=".$id."\n\n");
header ("Content-Type: application/octet-stream");
header ("Content-Length: ".filesize($enlace));
readfile($enlace);
?>
Espero que os funcione. Saludos. |