Downloads are not working?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dirko
Forum Newbie
Posts: 1
Joined: Sat Mar 20, 2004 10:25 am
Location: Germany, Hessen
Contact:

Downloads are not working?

Post by dirko »

Hi forum-folks

Is it an arror of my client-computer or a server error?
I cannot download the packages - each (forward)-downdoad quits with the message: Site cold'nt be opened, not Available.
IE: the (non-Working) Meta-Refresh shows the URL:
http://www.phpclasses.org/browse/packag ... -03-13.zip
The (working) direct-download-Link is the same:
http://www.phpclasses.org/browse/packag ... -03-13.zip

Maybe it's a ZoneAlarm-Setting?
I don't know...

DIRK
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Quote from user-notes in http://www.php.net/header?
There is this nasty bug in IE 5 for Windows prior to service pack 2, described in Microsoft knowledgebase article Q281197 which causes a problem with redirecting.. if you submit a POST form to a page that uses header() to redirect to another page after processing the form data, then IE will not display some of the images on the page, if the user has an "external HTTP namespace handler" (RealDownload for example) installed. It took me a very long time to figure this out; I had no idea why my ads weren't displaying on IE for windows but worked fine everywhere else.
Something I am using this for image-downloads - works in all browser I've tested it with (IE, Netscape, Mozilla, Opera)

Code: Select all

<?php
if ($download)
	{
	header("Cache-control: private");
	header("Content-type: application/octet-stream");
	header("Content-Disposition: attachment; filename=".$image[name].".jpg");
    header("Content-length: ".filesize($filename)."\n");

    //send file contents
    $fp=fopen($filename, "r");
    fpassthru($fp);
	}

?>
Post Reply