hadinetcat Posted September 4, 2013 Share Posted September 4, 2013 while downloading file getting garbage please help required. i have tried all the possibilities im using BLOB data type in mysql filed. i tried "ob_end_clean". and also I tried off "buffer_output" and on it, but not helping. v?—x¢b(°®ه– çzٍڈà÷µï½zTَکêùQïىxùSَ–jîآ·×Yï¹oف5KK÷¾oصتمح+¾¦œ:و†ƒloوnأ"گ ±Oّ•زـ¦§w8^uLٹé†-ئûpfچâ+أجشƒœر د؛-ںe•ؤ…¬RH¦ hْDyے#½=@'X'§¾ذXœtz”†رص0âLوٍ›“ء²{÷ڈے ½}f؛ِâB¦کژ¯“كگyeطPeüpy,¥¼تِŒً•MR±wگCي¢âٹ‘¬}Fzى3¢e¾NAو^4è¬{j=¤ر³جسâل<¶–5Mz&@+MYN1ُ¨Cںq)زêذش£M nj]T‡à*×h0ï3D¤6غإQ.µg¬€ء¥w«ي|م+s“çكûmٍاe¯Œغ½وؤ~لà…½ں$/‡ھ(!·@‡]µظtحîز4»CQeں[°ظ5گ+è’ہù4›MQd™@ں|‡فژd؟×ë×F*xز‘ ¹’پ÷i·?ù×ـسخ½Mأ}ق¸َOe$ِ à'ظgءl”ƒ=fRن(rإهـPy¨2ش2ج:طQî49œt رA3kfفذ’){¯'7ذE=»نx¾ةLb|‘شاـ×s ل‡ةأجô‰—ثSùy¦y†uھc>ا/’›Zç9Vٍ·بش&¸ةq“s؟Yعlzگïگ_v¼ئ؟!؟د h=لّ’ےJتْ…£ںبb÷U;Lآڑ›eڑƒ¨}كFپ ں›Uنvi>“]¤vçW†•Bڑˆˆ´!ج=¥4†é1حز ہحٹ‚é?“ل¢qع¬ ض4‹فلtڑgؤbوT§ةŒEچ8“س©#ôںآ‹EW9—ھr ‘8ژ§¦z$»±¸SW •¨xضث؛i›©سؤ™ا¾YهسaکؤvC«صژkœچ “ژr\îW"Tùؤ'œ¥<غàû<§«،«ئ¶ —ًيFل¥رکً³ظ(WVتG{i®> stream xœه]ëڈeإqXXVثs1ث‚¹ ;†¹ôûAâDٹEت7[Hùùd'N"ضر’ے_JUWَُô¹sg¦w±#ygخمVWuWWW?~Oâ(صAàüةف¯çüك»éد‡ےxWë®4ٌ£;Hkز؟ے_ؤƒSر~ü÷»ےQpئ¨C0؛{,=ƒ=َù‰ég”qً?™ïH،l{[:گJ›Uي¢؛ٍص,أوm)¤>ٌ6فے°R:^ùêî[ثٹ3¢¾m…ƒضŒ‡ إVeززF{{0BMˆڑں°îùخVيئ[ّ هYPüG6Eàغn{[£´Rآدù•د¥·ءىفس¾¸÷‹~÷=ِ/ my code <?php error_reporting(E_ALL); $company =$_GET['company]; if(isset($_GET['id'])) { $id = intval($_GET['id']); if($id <= 0) { die('The ID is invalid!'); } else { $dbLink = new mysqli('localhost', 'sqldata', 'sqldata', 'balhaf'); if(mysqli_connect_errno()) { die("MySQL connection failed: ". mysqli_connect_error()); } $query = "SELECT mime, name, size, data FROM $company WHERE id = $id"; $result = $dbLink->query($query); if($result) { if($result->num_rows == 1) { $row = mysqli_fetch_assoc($result); header("Content-Type: application/pdf"); header("Content-Disposition: attachment; filename=". $row['name']); header("Content-Length: ".$row['size']); echo $row['data']; } else { echo 'Error! No image exists with that ID.'; } @mysqli_free_result($result); } else { echo "Error! Query failed: <pre>{$dbLink->error}</pre>"; } @mysqli_close($dbLink); } } else { echo 'Error! No ID was passed.'; } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.