alena1347 Posted February 27, 2013 Share Posted February 27, 2013 Having a download issue need help 1)I used the script written below to download .doc,.docx,.pdf,.octetstream file but when i download a octetstream file it display's file data in browser itself mycode:- if(file_exists('./upload_resume/'.$f)) { header('Content-type: application/octet-stream'); header('Content-Disposition: attachment; filename="'.$f.'"'); echo file_get_contents('./upload_resume/'.basename($f)); ob_clean(); ob_end_flush(); $read=readfile('./upload_resume/'.basename($f)); exit; ?> <script type="text/javascript"> history.back(); </script> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/275006-download-issues/ 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.