Re: Prompt to "Save As" No Matter What The File Type
From: Shawn Wilson (shawn_at_glassgiant.com)
Date: 01/27/04
- Previous message: Jedi121: "Re: Prompt to "Save As" No Matter What The File Type"
- In reply to: Richie: "Prompt to "Save As" No Matter What The File Type"
- Next in thread: laidbak: "Re: Prompt to "Save As" No Matter What The File Type"
- Reply: laidbak: "Re: Prompt to "Save As" No Matter What The File Type"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: Jedi121: "Re: Prompt to "Save As" No Matter What The File Type"
- In reply to: Richie: "Prompt to "Save As" No Matter What The File Type"
- Next in thread: laidbak: "Re: Prompt to "Save As" No Matter What The File Type"
- Reply: laidbak: "Re: Prompt to "Save As" No Matter What The File Type"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|