Results 1 to 3 of 3

Thread: Making a "download.php" File

  1. #1
    Join Date
    Feb 2009
    Posts
    303
    Thanks
    18
    Thanked 36 Times in 36 Posts

    Question Making a "download.php" File

    I've searched on Google, but can't find anything... How do you make one of those PHP files that automatically shows a download prompt?

    For example, if you go to download.php?file=filename.txt it'll show a download prompt instead of opening the file.

    I've seen this used in many places, and can't seem to find any source code for it.

    Thanks,
    X96
    Last edited by X96 Web Design; 06-18-2009 at 11:58 PM. Reason: Fixed.
    Alex Blackie, X96 Design
    My Website
    I specialize in: HTML5, CSS3, PHP, Ruby on Rails, MySQL, MongoDB, Linux Server Administration

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Here you go, you can either learn from it or just use it:

    http://www.zubrag.com/scripts/download.php

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. The Following User Says Thank You to thetestingsite For This Useful Post:

    X96 Web Design (06-18-2009)

  4. #3
    Join Date
    Feb 2009
    Posts
    303
    Thanks
    18
    Thanked 36 Times in 36 Posts

    Default

    Thanks! Exactly what I was looking for.

    // X96 \\
    Alex Blackie, X96 Design
    My Website
    I specialize in: HTML5, CSS3, PHP, Ruby on Rails, MySQL, MongoDB, Linux Server Administration

Bookmarks

Posting Permissions

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