Re: Prompt to "Save As" No Matter What The File Type

From: Shawn Wilson (shawn_at_glassgiant.com)
Date: 01/27/04

  • Next message: J French: "Re: No answer for your problem ?"
    Date: Tue, 27 Jan 2004 16:27:15 -0400
    
    

    Richie wrote:
    >
    > What I want is to have a link to a file (it could be a .zip, .exe, .jpg,
    > .txt or even .html) and when the user clicks on it they are prompted with
    > the Save As box, as opposed to it opening in the browser.
    > I think I need to do something like:
    >
    > $fp = fopen($filetooutput, "rb");
    > $thefile = fread($fp, filesize($thefiletooutput));
    > header("Content-type: ???/???"); not sure what to put instead of the ???
    > echo $thefile;

    Google for content-disposition header. Set it to "attachment", I think. That
    doesn't work on some browsers, though.

    Shawn

    -- 
    Shawn Wilson
    shawn@glassgiant.com
    http://www.glassgiant.com
    

  • Next message: J French: "Re: No answer for your problem ?"

    Relevant Pages