Forum Moderators: coopster & phranque

Message Too Old, No Replies

How to start a download...

and how to make the browser show the proper info?

         

transistor

5:40 pm on Jul 3, 2002 (gmt 0)

10+ Year Member



So maybe this works for Windows IE browsers to start a download and show the appropiate information (Filename, file size and ETD (estimated time for download)).
But this doesn't work for all browsers, specially for the Mac.
I've tried quite some combinations but the best I can get in Mac is the browser asking what to do with the damn file, then you type the name (by default is download.php) and then start the download.
Can anyone help, please? Links, instructions, tutorials, tech-info welcome! Thanks!

header("Content-Type: application/download");
header("Content-Disposition: filename="$nombre.$ext"");
header("Content-Length: ".filesize($full_path));
header("Content-Transfer-Encoding: binary");
header("Connection: close");
readfile($full_path);
exit;

Lisa

4:24 am on Jul 4, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When I want to trick a browser I go find a HTTP Header Viewer and call the real document. Then I take the headers it gave out and use them. If the file extension is a problem you might want to mask another extension as a PHP type in your apache config.

stigsb

7:07 am on Jul 10, 2002 (gmt 0)

10+ Year Member



Does changing the Content-Disposition header to 'Content-Disposition: attachment; filename="..."' help for the Mac?

- Stig