Ver Mensaje Individual
  #9 (permalink)  
Antiguo 19/06/2008, 05:04
chefnelone
 
Fecha de Ingreso: diciembre-2005
Ubicación: Barcelona
Mensajes: 1.428
Antigüedad: 19 años, 2 meses
Puntos: 15
Respuesta: Seguridad para no acceder a ver archivos?

Ya casi lo tengo... pero lo que hace es bajar doc.php ?? Donde le estoy errando

el archivo que tiene que bajar esta en:
../clientesGestor/ClientsDocs/pag web.pdf

este es el codigo.

documentos2.php
Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<form action="verDoc.php" method="GET" >
<input type="hidden" name="nombrePdf" value="../clientesGestor/ClientsDocs/pag web.pdf" >
<input type="submit" value="Descargar" >
</form>
</body>
</html>
y el verDoc.php:
Código:
<?php
//*We'll*be*outputting*a*PDF 
header('Content-type: application/pdf'); 
//*It*will*be*called*downloaded.pdf 
header('Content-Disposition: attachment; filename="downloaded.pdf"'); 
//*The*PDF*source*is*in*original.pdf 
readfile('original.pdf'); 
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
</body>
</html>

Última edición por chefnelone; 19/06/2008 a las 05:11