I’m doing this page so files can be downloaded. They will have different file types, that’s why I use the file type as a variable.
$dbQuery = "SELECT blobType, blobData ";
$dbQuery .= "FROM myBlobs ";
$dbQuery .= “WHERE blobId = $blobId”;
$result = mysql_query($dbQuery) or die(“Couldn’t get file list”);
if(mysql_num_rows($result) == 1)
{
$fileType = @mysql_result($result, 0, “blobType”);
$fileContent = @mysql_result($result, 0, “blobData”);
header('Content-Type: ’ . $fileType); // HERE IS WHERE GIVES ME PROBLEMS
echo $fileContent;
}
else
{
echo “Record doesn’t exist.”;
}
It gives me this error message = Warning: Cannot modify header information - headers already sent by (output started at C:\apache\Apache2\htdocs\JAVASCRIPT\downloadfile.php:4) in C:\apache\Apache2…
Line 4 is where PHP starts (<?php). I already read from php.net and tried some suggestions, but it doesn’t seem to work.
Please help :hair:
Leo:)