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"..afte r 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_attac hment WHERE att_id = ".$_REQUEST['att_id'];
$result = mysql_query($qu ery, $db);
if ($result){
while($row = mysql_fetch_arr ay($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="'.$at t_name.'"');
header("Cache-Control: must-revalidate");
header("Content-Type: ".$att_type );
readfile($locat ion);
//ini_set('zlib.o utput_compressi on','Off');
exit();
?>
can anyone help me with this?
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"..afte r 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_attac hment WHERE att_id = ".$_REQUEST['att_id'];
$result = mysql_query($qu ery, $db);
if ($result){
while($row = mysql_fetch_arr ay($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="'.$at t_name.'"');
header("Cache-Control: must-revalidate");
header("Content-Type: ".$att_type );
readfile($locat ion);
//ini_set('zlib.o utput_compressi on','Off');
exit();
?>
can anyone help me with this?
Comment