Re: Bajar ficheros del Servidor(JAVIER <jl>)
| From: | Antonio Jos� | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: Bajar ficheros del Servidor(JAVIER <jl>) | ||
| References: | 1 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-34804@lists.php.net to get a copy of this message | ||
Pues ahí lo tienes:
<?php
header("Content-Type: application/x-msdownload\n");
header("Content-Disposition: attachment;
filename=".basename($f).";\n"); // For Other browsers
$f=urldecode($f);
//header("Content-Type: application/ms-word\n");
header("Content-Disposition: filename=$f;"); // A mi entender la línea
claves es esta... :)
readfile("C:\\Inetpub\\wwwroot\\DOCUMENTOS\\".$f);
echo $f;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www
w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Descarga de Ficheros</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
</head>
<body>
</body>
</html>
Antonio José Martínez Zaragoza
Pronared, S.L.
e-mail: azaragoza@pronared.es