Force download files using php
Hello guys here is a simple yet powerful script that allows you guys to force the users download some files with the dialog box Do you want to open or save the file, just copy paste the script below.
<?php header(”Content-type:application/octect-stream”);
header(’Content-Disposition: attachment; filename=Test_Download_For_’ . date(’Y-m-d’) . ‘.txt’);
print “This is the file you downloaded, Its easy rgt :)”;
?>
Thanks Guys
Related posts:
- “Header already sent” in php error and other use of Header function in PHP
- Export MySQL to CSV (Excel) using php
- How to get your deleted files back using google desktop?
- Simple php watermark script
