RE: Re: Setting headers for file download

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I got it working on one server, but not the real server. I just took your
code and voila it was working (with some modifications).

It works on:
Localhost Windows
Plesk Server running Plesk 7.5

Not working on:
Plesk Server running Plesk 7.0

Then the questions is: Where should I start to search in WHY the server is
not sending the correct headers? This is becoming more and more irritating
:)

Best regards,
Peter Lauri



-----Original Message-----
From: Rafael [mailto:rsalazarm@xxxxxxxxx] 
Sent: Wednesday, June 14, 2006 6:28 AM
To: php-general@xxxxxxxxxxxxx
Subject:  Re: Setting headers for file download

	I use something like this...
   $file_len = filesize($file_name);
   $file_ts  = filemtime($file_name);
   header('Content-Type: application/x-octet-stream'); // none known
   header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
   header('Last-Modified: '. gmdate('D, d M Y H:i:s', $file_ts) .' GMT');
   header('Content-Disposition: attachment; filename="'. 
basename($file_name) .'"');
   header("Content-Length: $file_len");
   readfile($file_name);


Peter Lauri wrote:
> Best group member,
> 
> This is how I try to push files to download using headers:
> 
> header("Content-type: $file_type");
> header("Content-Disposition: attachment; filename=$filename"); 
> print $file;
> 
> It works fine in FireFox, but not that good in IE. I have been googled to
> find the fix for IE, but I can not find it. Anyone with experience of
this?
> 
> Best regards,
> Peter Lauri

-- 
Atentamente / Sincerely,
J. Rafael Salazar Magaña

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

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux