|
hello everyone.. can anybody help me?
i made an application to upload files to the server..
and after that use ris able to download that file again..
but after downloading the file (specifically word document), i found that the content is not correct..
lets say the original content is "This is a word document"..after downloading the file..the content becomes "&@%&*@**)@!)(!@)((___@!#" (some invalid unreadable characters)..
what cause this error? i also cannot view a jpeg document after downloading it..
here's the script for my download.php :
<?
ob_start();
session_start();
include 'config.php';
include 'opendb.php';
$query = "SELECT * FROM phpgw_dts_attachment WHERE att_id = ".$_REQUEST['att_id'];
$result = mysql_query($query, $db);
if ($result){
while($row = mysql_fetch_array($result))
{
$att_name = $row['att_name'];
$att_path = $row['att_path'];
$location = $att_path.$row['att_tempname'];
$att_type = $row['att_type'];
}
}
header('Content-Disposition: attachment; filename="'.$att_name.'"');
header("Cache-Control: must-revalidate");
header("Content-Type: ".$att_type);
readfile($location);
//ini_set('zlib.output_compression','Off');
exit();
?>
can anyone help me with this?
|