Descargar ficheros(urgente)
Hola, estoy haciendo una aplicación donde necesito descargar ficheros. Este es el código que he hecho:
download($HTTP_GET_VARS['fich'],$HTTP_GET_VARS['tipo']);
function download($url,$tipo)
{
$TheFile = basename($url);
header ("Content-Disposition: attachment; filename=".$TheFile."nn");
header ("Content-Type: application/octet-stream");
header ("Content-Length: ".filesize($url));
readfile($url);
return;
}
Con este código solo consigo bajarme pdf..estoy intentandolo con ficheros ppt y el power point cuando se abre me dice qeu no puede abrir el fichero.
Con ficheros word se abre el documento pero con un monton de caracteres raros.
Alguna idea?
Gracias
download($HTTP_GET_VARS['fich'],$HTTP_GET_VARS['tipo']);
function download($url,$tipo)
{
$TheFile = basename($url);
header ("Content-Disposition: attachment; filename=".$TheFile."nn");
header ("Content-Type: application/octet-stream");
header ("Content-Length: ".filesize($url));
readfile($url);
return;
}
Con este código solo consigo bajarme pdf..estoy intentandolo con ficheros ppt y el power point cuando se abre me dice qeu no puede abrir el fichero.
Con ficheros word se abre el documento pero con un monton de caracteres raros.
Alguna idea?
Gracias
Leete el articulo que esta en el siguiente enlace
http://www.aesthetic-theory.com/learn.php?throttle
o copia la funcion download que esta en el mismo
http://www.aesthetic-theory.com/learn.php?throttle
o copia la funcion download que esta en el mismo
