I just thought that members of this list following this thread might
like to know the results of my experimenting with this technique:

All tests on Linux (testing on Windows 98 tomorrow):

        * Mozilla 0.9.9 worked perfectly.
        * Netscape 4.78 appeared to work but downloaded file was very
          slightly larger than original (can't tell if that's a problem
          because it's a Windows binary).
        * Konqueror 2.2.1 downloaded the binary, but opened a file save
          as dialog defaulted to the script name not the name in
          Content-Disposition, and failed to display the HTML.
        * Opera 5.05 (don't have 6.0 yet) crashes instantly and crashes
          X with it!

I'll let you know (if you're interested) the results of testing on
Windows tomorrow. Look like it might have to be the meta http-equiv
refresh technique after all (although I'm worried about the browser
attempting to display the file instead of saving it with that
technique).

Thank to everyone for their help.

Best, Darren

On Tue, 2002-05-21 at 21:02, Billy S Halsey wrote:
> Hi,
> 
> Here's the shell of a script I wrote a while back to do exactly what you 
> want:
> 
> <?php
> 
> header("Content-Type: multipart/mixed; boundary=\"-Boundary-12399\"");
> 
> print "---Boundary-12399\r\n";
> print "Content-Type: text/html\r\n";
> print "\r\n";
> 
> // Your HTML code goes here
> 
> print "\n";
> print "---Boundary-12399\r\n";
> print "Content-Type: application/octet-stream\r\n";
> print "Content-Disposition: attachment; filename=foo.tar.gz\r\n\r\n";
> readfile("./foo.tar.gz");
> 
> print "---Boundary-12399--\r\n";
> print "\r\n";
> 
> ?>
> 
> 
> Note the format of the "Boundary" headers, especially the dashes.

-- 
======================================================================
D. D. Brierton            [EMAIL PROTECTED]           www.dzr-web.com
        Trying is the first step before failure (Homer Simpson)
======================================================================

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to