descargar.php
Código PHP:
   <?php include('head.php')?>
  <!-- CONTENT -->
  <div id="content">
    <?php include('sidebar.php')?>
    <div id="right">
      <div id="welcome">
        <h1> </h1>
        <?php
          require('admin/config/connect.php');
          $cargar= "SELECT * FROM $tabla1 ORDER BY id DESC LIMIT 1";
          $resp= mysql_query($cargar);
          while($row= mysql_fetch_array($resp)){
              $archivo= $row['nombre'];
              $ext= $row['extension'];
              $bytes= $row['size'];
              $release= $row['contenido'];
              $version= $row['version'];
             }
             mysql_close($connect);
             
             function bytesToSize($bytes,$precision= 2){ 
             $kilobyte = 1024; 
             $megabyte = $kilobyte * 1024; 
             $gigabyte = $megabyte * 1024;
             $terabyte = $gigabyte * 1024;
             
             if(($bytes >= 0)&&($bytes < $kilobyte)){
                 return $bytes . ' B';
                 }elseif
                 (($bytes >= $kilobyte)&&($bytes < $megabyte)){
                     return round($bytes / $kilobyte,$precision) . ' KB';
                     }elseif
                     (($bytes >= $megabyte)&&($bytes < $gigabyte)){
                         return round($bytes / $megabyte, $precision) . ' MB';
                         }else{
                             return $bytes . ' B';
            }//Fin del If
            }//Fin del If function
            $size= bytesToSize($bytes); 
          ?>
          <a href="deposito/download.php?file=<?php echo $archivo.$ext ?>" title="Descargar <?php echo $archivo?>" target="_blank"><img src="images/descargar.gif" width="450" height="150" style="border:none; text-decoration:none;" /></a>        
        <p><strong>ARCHIVO: </strong><span style="font-size:14px;"><?php echo $archivo ?></span></p>     
        <p><strong>VERSIÓN: </strong><span style="font-size:14px;"><?php echo $version ?></span></p>       
        <p><strong>TAMAÑO: </strong><span style="font-size:14px;"><?php echo $size ?></span></p>  
        <p><strong>COMPRESIÓN: </strong><span style="font-size:14px;"><?php echo $ext ?></span></p>  
        <p><strong>RELEASE: </strong><span style="font-size:14px;"><?php echo $release ?></span></p>
                                  
        <div class="clear"></div>
      </div>
      <br/>
      <div id="block_left">
        <h1>Bloque Publicitario!</h1>
        <iframe width="300" height="250" frameborder="0" scrolling="no" allowtransparency="true" src='http://ads-plus.url.ph/ads_plus/ip2c_rand/300x250/random.php' hspace="2" vspace="2" marginheight="1" marginwidth="1"></iframe>
        </div>
 
      <div id="block_right">
        <h1>Bloque Publicitario!</h1>
        <iframe width="300" height="250" frameborder="0" scrolling="no" allowtransparency="true" src='http://ads-plus.url.ph/ads_plus/ip2c_rand/300x250/random.php' hspace="2" vspace="2" marginheight="1" marginwidth="1"></iframe>
      </div>
      <div class="clear"></div>
    </div>
  </div>
  <div class="clear"></div>
  <!-- CONTENT END -->
<?php include('footer.php')?>    download.php
Código PHP:
   <?php
if (!isset($_GET['file']) || empty($_GET['file'])) {
 exit();
}
$root = '';
$file = basename($_GET['file']);
$path = $root.$file;
$type = '';
 
if (is_file($path)) {
 $size = filesize($path);
 if (function_exists('mime_content_type')) {
 $type = mime_content_type($path);
 } else if (function_exists('finfo_file')) {
 $info = finfo_open(FILEINFO_MIME);
 $type = finfo_file($info, $path);
 finfo_close($info);
 }
 if ($type == '') {
 $type = "application/force-download";
 }
 // Definir headers
 header("Content-Type: $type");
 header("Content-Disposition: attachment; filename=$file");
 header("Content-Transfer-Encoding: binary");
 header("Content-Length: " . $size);
 // Descargar archivo
 readfile($path);
} else {
 die("El archivo no existe.");
}
?>    Aca les dejo mi pagina con el links, le dan a descargar y les pondra q no existe (cuando en realidad si existe)
http://ads-plus.url.ph/descargar.php
Q es lo q puede estar fallando??
 
 

