leela Posted September 12, 2007 Share Posted September 12, 2007 Hai , I Was struck up here .. When i download , instead of open/save dialogue box ...... the content in the file is displaying .. Here is my code $sql="select * from tbl_images where id='".$id_img."' "; $res=mysql_query($sql); $arr=array(); while($row=mysql_fetch_array($res)) { array_push($arr,$row); } $file="personal_photos/".$arr[0]['path']; header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: header/force-download"); header( "Content-Disposition: attachment; filename=".basename($file)); header( "Content-Description: File Transfer"); @readfile($file); Plz some one tell me where the mistake is ??? Thanks,Leela Link to comment https://forums.phpfreaks.com/topic/68968-problem-in-downloading/ Share on other sites More sharing options...
jitesh Posted September 12, 2007 Share Posted September 12, 2007 header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); header("Content-Type: image/jpeg"); header('Content-Description: File Transfer'); header("Content-Disposition: attachment; filename=\"".basename($filename)."\";"); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($filename)); set_time_limit(0); @readfile("$filename") or die("File not found."); Link to comment https://forums.phpfreaks.com/topic/68968-problem-in-downloading/#findComment-346707 Share on other sites More sharing options...
leela Posted September 12, 2007 Author Share Posted September 12, 2007 ThankYou ..I got the result Link to comment https://forums.phpfreaks.com/topic/68968-problem-in-downloading/#findComment-346797 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.