Ver Mensaje Individual
  #8 (permalink)  
Antiguo 15/03/2006, 15:39
Avatar de Bullet
Bullet
 
Fecha de Ingreso: agosto-2005
Ubicación: Margarita, Venezuela
Mensajes: 235
Antigüedad: 18 años, 9 meses
Puntos: 1
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($fp4096);
            }
            
// 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