www.webdeveloper.com
Results 1 to 3 of 3

Thread: how to download directly a file?

  1. #1
    Join Date
    Nov 2004
    Posts
    3

    how to download directly a file?

    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
    www.imaginando.net

  2. #2
    Join Date
    Jun 2004
    Location
    4846′36″ N 910′48″ E
    Posts
    3,747
    what format are the file?
    text, is it?

  3. #3
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    Code:
    <?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.
    Stephen

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles