[QUOTE=php_lover;4343082]Hi all , I've writen a piece of code downloading file from mysql , here is the code :
php code :
$query = "SELECT name, type, size, content ,downloaded FROM ".filtering($cat , 'str')." WHERE id = '".filtering($id , 'int')."'";
$result = mysqlquery($query) or die('Error, query failed !!!');
list($name, $type, $size, $content, $downloaded) = mysql_fetch_array($result);
header("Content-length: $size");
header("Content-type: $type");
header("Content-Disposition: attachment; filename=$name");
echo $content;
exit;
}
nothing is fail , when I try this script on my local machine the download window appears to me that where I whould download the file but when I try it on my server the download window won't appear and the content of file is shown on browser
for example when I want download .rar file these codes appear exchange of downloading window :
EVئ€#% ئ€"% èï‹ ‹}3غYئD0 C‹uhSC Vèڈ …ہYY…¢ 9E„=ےے…ےj^‰uüŒQےےےujXè(üےے…ہY…=ےے…ےtےu3ہےuèûےےYYé%ےے‹Mٹ‹ٌë<:tFٹ„ہuُ€> „µ ‹ئ+ء= r¸ے P‹Eےu¬ Pèظ‹ ‹EFVئ€« è›چ ‹M‹uƒؤ‰پ¬ hSC Vè^ژ …ہYY…ئ 9E„†ےے…ےj[‰]üŒےےVjXèsûےے…ہY…ےے…ے…† hSC ے