Tengo un problemilla con la descarga de archivos.
![triste](http://static.forosdelweb.com/fdwtheme/images/smilies/frown.png)
Consigo que me salga la ventanita en la que dices si quieres guardar el archivo o abrirlo, cuando le doy a guardar funciona bien, pero cuando le doy a abrir me da un error (no puede abrirlo). Lo he probado con arcivos pdf que nunca me han dado ningún problema al abrirlos.
![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
¿Alguien puede orientarme?.
![sonrisota](http://static.forosdelweb.com/fdwtheme/images/smilies/xD.png)
El código que tengo es:
<?
$filename = $HTTP_GET_VARS['arch'];
$size = filesize($filename);
header("Pragma: no-cache");
header("Last-Modified: " . gmdate("D, d M Y H:i:s T", filemtime($filename)));
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Expires: 0");
header("Content-Transfer-Encoding: binary");
header("Content-type: application/force-download");
header("Content-Disposition: attachment; filename=$filename");
header("Content-Length: $size");
readfile("$filename");
?>
Gracias. Salu2.
![Adios](http://static.forosdelweb.com/fdwtheme/images/smilies/adios.gif)