aki les va el script, es algo largo, por lo q voy a poner solo la parte q descarga el archivo:
Código PHP:
<?
//********************************** CONECCIÓN*****************************
include('descargafichero.php');
$conex = mysql_connect("localhost","root");
mysql_select_db("db_ihm", $conex);
//********************************descarga*********************************
// setup the query
$query = "select file_path, file_name from tbl_files where file_id = $fid";
// get results
if($result = mysql_query( $query, $conex)) {
// if we have results
if($row = mysql_fetch_array($result)) {
// get filename and path
$file_name = $row['file_name'];
$file_path = $row['file_path'];
// send the necessary headers.
// i found that these work well.
header("Content-Type: application/octetstream");
header("Content-Disposition: filename= $file_name");
// open the file for reading and start dumping it to the browser
if($fp = fopen($file_path.$file_name, "r")) {
while(!feof($fp)) {
echo fgets($fp, 4096);
}
// close the file
fclose($fp);
}
}
}
?>
esta es la parte del codigo q uso para bajar el archivo, nose si seran las cabeceras o que!! spero me puedan ayudar!!saludos