Re: Re: IE download problem

From: Date: Wed, 26 Nov 2003 17:28:04 +0000
Subject: Re: Re: IE download problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-171104@lists.php.net to get a copy of this message
Oh, so you're actively trying to trick IE, are you? Why don't you provide the proper image/jpeg MIME type? And why do you add a newline character at the end of the MIME type? (As previously asked before.) Bogdan Luis Lebron wrote:
Here's the error I'm getting "Internet Explorer cannot download...?sender=171&filename=0000.jpg from somedomain.com. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later." thanks, Luis -----Original Message----- From: Bogdan Stancescu [mailto:gutza@moongate.ro] Sent: Wednesday, November 26, 2003 11:14 AM To: php-general@lists.php.net Subject: Re: [PHP] Re: IE download problem I was thinking the same. But until we can squeeze some information about the actual error from Luis, I think we're stuck. Bogdan Warren Vail wrote:
Could the problem be the associations stored in the windows system
registry?
I've had problems trying to download files whose name ends in a suffix
that
is registered as being associated with a given program (i.e. .txt with notepad, .doc with word). I believe that IE tries to open the file in the registered application and Netscape doesn't always do that (could be wrong here, but that's how it seemed to me). Warren -----Original Message----- From: Luis Lebron [mailto:llebron@sigmatech.com] Sent: Wednesday, November 26, 2003 8:54 AM To: 'pete M'; php-general@lists.php.net Subject: RE: [PHP] Re: IE download problem I tried your code. I'm still getting the same errors. thanks, Luis -----Original Message----- From: pete M [mailto:pmorgan@ukds.net] Sent: Wednesday, November 26, 2003 10:52 AM To: php-general@lists.php.net Subject: [PHP] Re: IE download problem thsi si a nighmare area..... and loast days on same problem This works for me.. hope it does for you $file = $_GET['file']; $path = '/www/cgi-bin/docu/personal/'.$file;
        //force download dialog
    header("Content-type: application/octet-stream\n");
    header("Content-disposition: attachment; filename=\"$file\"\n");
    header("Content-transfer-encoding: binary\n");
    header("Content-length: " . filesize($path) . "\n");
    //send file contents
    $fp=fopen($path, "r");
    fpassthru($fp);
Luis Lebron wrote:
I am working on a script to force downloading a file. The script works
fine
with NS (4.8 and 7) but does not work correctly with IE 6.0 I have looked at examples on php.net and have googled for a solution, but still can't find a solution. I think IE wants to download the script
instead
of the file. Here's what the code I'm working on looks like: <?php $sender=$_GET["sender"]; $filename=$_GET["filename"]; //Data validation goes here $filePath="../users/".$sender."/".$filename; if(file_exists($filePath)) { Header("Content-Length: ".filesize($filePath)); Header("Content-type: application/download"); Header("Content-Disposition-type: attachment"); Header("Content-Disposition: filename=\"".$filename."\"\n"); Header("Content-Transfer-Encoding: binary"); $fp = fopen($filePath,"rb"); fpassthru($fp); } ?> The funny thing is that I have a similar script that I use to download an sql file and it works correctly. Luis R. Lebron Sigmatech, Inc


« previous php.general (#171104) next »