Click to See Complete Forum and Search --> : how to download directly a file?


lpx
01-21-2006, 07:45 AM
Hi!

How can i make a file to be downloaded after being generated by php for example?

The thing is that i have a mailing list integrated in my site and i want to be able to export the mails that i have in the database.

How can i make a window appear to download that file after i get them from the database?

Many thx

LiLcRaZyFuZzY
01-21-2006, 08:25 AM
what format are the file?
text, is it?

felgall
01-21-2006, 04:40 PM
<?php
header('Content-Disposition: attachment; filename="file.txt"');
?>


Will make file.txt downloadable when linked from the current page instead of it being displayed in the browser.