Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/01/2012, 18:05
Avatar de Yawin
Yawin
 
Fecha de Ingreso: enero-2012
Ubicación: En Narnia.
Mensajes: 12
Antigüedad: 12 años, 3 meses
Puntos: 0
Problemas con headers

Hola a todos. La verdad es que tengo un problema que no llego a comprander. Estoy haciendo una pequeña web de subidas y descargas para mi asociación, y tengo problemas con el "download.php".

Si os soy sincero, me temo que estoy en punto muerto con este error.

El error que me sale es el siguiente:
Código:
Warning: Cannot modify header information - headers already sent by (output started at /homez.221/pensares/www/download.php:1) in /homez.221/pensares/www/download.php on line 10

Warning: Cannot modify header information - headers already sent by (output started at /homez.221/pensares/www/download.php:1) in /homez.221/pensares/www/download.php on line 11

Warning: filesize() [function.filesize]: Stat failed for ups/tubeespana.rar (errno=2 - No such file or directory) in /homez.221/pensares/www/download.php on line 12

Warning: Cannot modify header information - headers already sent by (output started at /homez.221/pensares/www/download.php:1) in /homez.221/pensares/www/download.php on line 12

Warning: readfile(ups/tubeespana.rar) [function.readfile]: failed to open stream: No such file or directory in /homez.221/pensares/www/download.php on line 13
Mi código es este:
Código:
<?
	require("contenido/conexion.php");

	$select = mysql_query('SELECT * FROM yawdes_archivos WHERE ID='.$_GET['id']);
	$not=mysql_fetch_array($select);

	if($not['Bloq']!=1)
	{
		$enlace = 'ups/'.$not['Ruta'];
		header ("Content-Disposition: attachment; filename=".$not['Ruta']." ");
		header ("Content-Type: application/octet-stream");
		header ("Content-Length: ".filesize($enlace));
		readfile($enlace);
	}
	else
	{ ?>
		<div id="login" class="shadow">
			<div style="margin-left:25px; padding-top:25px;">
				Imposible comenzar la descarga. El archivo est&aacute; bloqueado.
			</div>
	        </div>
	<? }
?>
El archivo "conexion.php" es este:
Código:
<?php

$conectar = mysql_connect("xxxxx", "xxxxx", "xxxxx");
$base_datos = mysql_select_db("xxxxx", $conectar);

?>