25 Apr

Force Download Dialog with PHP using octect-stream

Use this code to force a download of any type of content with PHP


header("Content-type:application/octect-stream");
header('Content-Disposition: attachment; filename=filename_' . date('Y-m-d') . '.sql');
print "Hello World";

Leave a Reply

Your email address will not be published. Required fields are marked *