Hello Eddie,

As Jim <[EMAIL PROTECTED]> correctly noted you should play with
MIME types. Here is a working solution, it works correclty in MSIE6,
Netscape6.2, Netscape4.7, GetRight :-), and partly works in Opera6.1

disp.php:
<?php
         $file = 'moyo.jpg';
         $fp = fopen($file, 'rb');
         header('Content-type: application/x-unknown');
         header('Content-disposition: "attachment"; filename="saved_moyo.jpg"; 
size='.(string)filesize($file));
         while (!feof($fp)) {
               echo fread($fp, 1024);
         }
?>
This bit of code allows you to save any file under specified name.
In Opera6 "Save As..." pops up, but file saves under script name, and
not under specified name.

Not very useful with large files, because it does not support resume,
and if connection brokes user will have to re-download file from the
beginning.

You can also use fpassthru() or readfile(), but I would not recommend
it, because these 2 functions attempt to read an entire file into
memory and then output it, and we don't want to have large files in
memory, do we :-)

working example: http://creep.kicks-ass.org/disp.php

Links:
http://www.ietf.org/rfc/rfc2183.txt?number=2183
http://php.net/fopen
http://php.net/fpassthru
http://php.net/readfile
http://php.net/header
http://php.net/feof

Tuesday, January 07, 2003, 5:22:18 PM, you wrote:

EC> When you left click on files it will download it immediately or first
EC> display it depending the file extension. So when clicking on an .pdf
EC> file will download it but clicking on a .jpg or .txt file will show
EC> it.

EC> Apparently there is a possibility in PHP that also .jpg and .txt files
EC> will be downloaded immediately when left clicking (it must work on all
EC> Browser types).

EC> Does any one have this experience and could pleas tell me how I can
EC> accomplish this?

-- 
Best regards,
 cr33p                            mailto:[EMAIL PROTECTED]
 ICQ:48533867
 MSN: [EMAIL PROTECTED]
 AIM: CreepyRunneR



____ � The WDVL Discussion List from WDVL.COM � ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] 
       Send Your Posts To: [EMAIL PROTECTED]
To change subscription settings to the wdvltalk digest version:
    http://wdvl.internet.com/WDVL/Forum/#sub

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to