Ver Mensaje Individual
  #2 (permalink)  
Antiguo 05/05/2015, 10:48
Avatar de chronos682
chronos682
 
Fecha de Ingreso: febrero-2004
Ubicación: Tunja - Boyacá - Colombia
Mensajes: 627
Antigüedad: 20 años, 8 meses
Puntos: 69
Respuesta: Evitar que se siga escribiendo información en archivo csv

Ya encontré la solución al problema. Por si a alguien le sirve esta es la forma correcta de escribir el archivo:

Código:
        $output = fopen( 'php://temp/maxmemory:'. (12*1024*1024) , 'r+' );
        fputcsv($output, Aqui el array a escribir,";");
	rewind($output);
	$buffer=stream_get_contents($output);
	fclose($output);
	header('Content-Type: text/csv; charset=utf-8');
	header('Content-Disposition: attachment; filename=data.csv');
	header('Content-Length: '. strlen($buffer));
	echo $buffer;
	exit;
Se puede dar por solucionado.
__________________
Si te gustó la respuesta dale +1

HERNÁN G. SIABATO M.
[email protected]