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

From: Richie (newsmaster_at_scifi-central.net)
Date: 01/27/04


Date: Tue, 27 Jan 2004 20:02:54 -0000

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;

If anyone can help that would be much appreciated
Richie



Relevant Pages

  • Re: Resend of- 7/15 ->2004: How zoom+ view of received small-font html newsletters?
    ... Not with complex HTML, which is what I suspect you're referring to. ... Copy this script from a message from Allen Watson: ... property browser: "" ... set theFile to theDisk & theFile ...
    (microsoft.public.mac.office.entourage)
  • Re: Strange file
    ... email with an HTML attachment, ... Tried opening it on with Firefox on the PC - same result. ... Either by opening them in a browser - usually Oregano 1 - or ... The email header says ...
    (comp.sys.acorn.misc)
  • Re: Problem with http:/www.mydomain.com/home.php/
    ... I have a problem when i type in the browser .. ... http:/www.mydomain.com/home.php (no forward slash at the end) ... its opening the same page ..but behaving very weird .. ... Use a base href tag in the head of your html. ...
    (comp.lang.php)
  • Re: Malware Triangle
    ... >> While HTML is not a programming language, ... It's a set of instructions to tell a browser ... Opening a zip file with Winzip doesn't cause its content to be ...
    (alt.computer.security)
  • Re: Resend of- 7/15 ->2004: How zoom+ view of received small-font html newsletters?
    ... > set theFile to theDisk & theFile ... > set ct to creator type of browser ... Mickey Stevens ...
    (microsoft.public.mac.office.entourage)