foreach ($idsonly as $key=>$price) {
if($curencyarray[$key]=="Internet Download"){
$dfr = $productidarray[$key].'.'.$itemformatarray[$key];
$file = 'C:wamp/www/allcars/Dhotois/'.$bigidarray[$key].'/'.$dfr;
$fie = str_replace("; charset=binary","",$mimeformarray[$key]);
$filename = $dfr;
$filepath = "C:wamp/www/allcars/Dhotois/".$bigidarray[$key]."/" . $filename;
set_time_limit(0);
ignore_user_abort(false);
ini_set('output_buffering', 0);
ini_set('zlib.output_compression', 0);
header("Content-Description: File Transfer");
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: ".$fie."");
header("Content-Disposition: attachment; filename=\"".basename($filepath)."");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".@filesize($filepath));
set_time_limit(0);
@readfile("$filepath") or die("File not found.");
ob_clean();
}
}
The above block of code runs but does not display the download box, the file i am trying to download is a jpeg file, i already set ob_start(); at the top of the page and if i remove the ob_clean(); from the code, it shows me this gibberish below
0041430000c945000015480000887a0000b3ca000094cf0000e1d6000011de0000a9860100��ICC_PROFILElcmsmntrRGB XYZ �)9acspAPPL���-lcms desc�^cprt\wtpthbkpt|rXYZ�gXYZ�bXYZ�rTRC�@gTRC�@bTRC�@descc2textFBXYZ ���-XYZ 3�XYZ o�8��XYZ b����XYZ $����curv��c�k�?Q4!�)�2;�FQw]�kpz���|�i�}���0����C "##! %*5-%'2( .?/279<<l� \8k�bR�K}Q�:�Câ��8�!�(��I5��6�}�xd�{���v���G���}�'��f<���c��������>��~m}|�l>��� ��Ǎ4�]�l����ϕ��Ǘ���3��1�ُ��b_�π�}��2=��B��G�m��^�x�7,+9m[�F�EW0i-�6- �"��<���"H��S��I�Db�{������)���|����BIL�d�������L&� ����a_��A��!�o�y{Iw���*T�Md�E����I�x�Q����=sv34��{���d�Y*8_-潏��K �ǭ���\ͪ2f:�%sp*�܂�#�҉tďu5���' �t!�\�f�}ֻ�9��ak�2���(� �8���qs��5��P�y�3e2P��7��W5��s�����Dߐn�4��,d[cBk�,�����&o>�2��>o?���S�I�X�ڭ�T�� �@G��K�>\� d�wL�&v'����Zty��b����i�8���Plgj��J���='���j����Y�n�帨��@�ի�\Z�����K��}w�mF3��?+�nMf0���T��-�45�m���,�-��JV$ad �!�(�u� �8��!Q��>"{���������W>�3� �5Rӣe}��H��S9�sw �Puf�Ud�5�2���*�9f$anys)D���x?{U<ߣ��d.�g�F7��4���˲�Uf�\��ͧq�lѱ%����&��F'Hp�\�#�J�08Ā+�H@�9w6n�]��k������8ک�_Y�~�E�%��۸�{p��]F�2,Y�ػ�|x�[�(��g
please, what could possibly be wrong with my code?, any help and i will be so grateful.