Hi Barry!
And I thought I was staring the whole night on this manual site. I guess I should have gone to bed....
Anyway, Barry: Thank you very much!!! I made it to work!
Markus
PS: Increased points to 150 again!
Main Topics
Browse All TopicsHi.
I'm trying to code a php download script. Everything works fine except when using Netscape.
The headers that I send look like this:
header("Content-Type: application/octet-stream")
header("Content-Dispositio
header("Content-Length: ".$size);
header("Content-Transfer-E
header("Connection: close");
If I use Netscape for downloading a file the download box pops up and asks for the location for filename.ext.php
All other browsers (IE, Opera) work fine (they download file filename.ext).
Where's the problem? What header is Netscape expecting?
Markus
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: axis_imgPosted on 2003-01-06 at 23:45:50ID: 7679898
Hi Markus... I was just looking through the man page for header(), and came across these two comments which may help you out. The page can be found here:
en/functio n.header.p hp
d.php?file =23 d.php/?fil e=23
n:"). I have finally manged it to fix that problem with the *.php extension by sending a content-type of:
ed
RS["HTTP_U SER_AGENT" ],"Gecko") ) header("Content-type: application/x-zip-compress ed\n"); ncoding: binary\n"); : attachment; filename=".$myname."\n";
http://www.php.net/manual/
Comment 1
------------
Another general fix for many of the problems that occure when trying to prompt a filename to download is to append a '/' to your download URL. This fixes a NS7 problem where it wants to add a .PHP extension to all filenames.
For example, change:
http://www.url.com/downloa
to
http://www.url.com/downloa
-------------
Comment 2
-------------
Regarding the Filename problems with NS7 / Mozilla when passing the filename via header("Content-Dispositio
application/x-zip-compress
and Mozilla does now recognize the .zip extension for my files.
Here is a short example:
if(stristr($HTTP_SERVER_VA
else header("Content-type: application/zip");
header("Content-transfer-e
$head="Content-Disposition
header($head);
header("Content-Length: ".$mylength);
Hope that helps someone, it took quite some time to figure out this problem...
-------------
Hope those are helpful... Unfortunately, it is a bug within NS7, so it is most likely going to require a hack like this.
Regards,
Barry