hello i have tryed a lot of source codes for this but i have the same error in all of them
include 'functii.php';
starts();
opendb();
$query = "SELECT content,`title_real`,`size`,`ext` FROM file WHERE file_id = '3'";
$result = mysql_query($query) or die('Error, query failed');
list($content,$filename,$size,$ext) = mysql_fetch_array($result);
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Disposition: attachment; filename=$filename.$ext");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".$size);
echo $content;
exit;
the problem is that in the downloaded file i have a lot of "\0" that came from nowhere. the file is well stored in the database. i tested that. thank you