downloading text file from mysql blob
Posted: Fri Oct 01, 2010 2:24 pm
All,
I am successfully downloading pdf and word docs from mysql. When I try to download a text file I get:
Cannot modify header information - headers already sent by ...
here is the code:
any ideas how to download text files?
I am successfully downloading pdf and word docs from mysql. When I try to download a text file I get:
Cannot modify header information - headers already sent by ...
here is the code:
Code: Select all
$download = "select data, mimeType, filename from minutes where minutesId='".$id."'";
$downloadResult = @mysql_query($download);
if($row = @mysql_fetch_array($downloadResult)){
$data = @mysql_result($downloadResult, 0, "data");
$mimeType = @mysql_result($downloadResult, 0, "mimeType");
$fileName = $_GET['filename'];
header("Content-type: $mimeType");
header("Content-Disposition: inline; filename=$fileName");