PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTTP » HTTP_Download » Bug #3194

Setting Cache to False blocks downloads

Details

Submitted2005-01-13 22:51 UTC
Fromelliot at onehouse dot net
Assignedmike
StatusClosed
PackageHTTP_Download
PHP Version4.3.10
OSLinux Redhat - 9
Roadmaps(Not assigned)

Comments

[2005-01-13 22:51 UTC] elliot at onehouse dot net

Description:
------------
When I set the cache value to false with the setCache method and I attempt to download a file in IE with SP2, the file does not download. If I remove the $dl->setCache(false); line from the code below, the download occurs.

Reproduce code:
---------------
$sFilePath = $sFilePath . "/" . $sFileName;
$dl = &new HTTP_Download();
$dl->setFile($sFilePath);
$dl->setContentDisposition( HTTP_DOWNLOAD_ATTACHMENT, rawurldecode($sFileName) );
$dl->guessContentType();
$dl->setCache(false);
$dl->send();

Expected result:
----------------
Download would occur.

Actual result:
--------------
The download dialogue appears and it looks like the file is beginning to download, but then an error message pops up:

"Internet Explorer cannot download page.php?dl=45 from 208.36.2.66

Internet Explorer was unable to open this internet site. The requested site is either unavailable or cannot be found. Please try again later"

[2005-01-14 09:10 UTC] elliot at onehouse dot net

Are you kidding... I feel like I have tried everything. But yes, included in my list of failed debugging attempts is clearing my browser cache. I've narrowed it down to the Pragma header. If it is deleted (by using the setCache(false) method) or set to no-cache, IE6 has problems when trying to download the document. One thing I noticed is that the 'open/download' dialogue shows the parameters list of the downloads webpage instead of the document name (e.g. ?dl=45 instead of doc.pdf).

[2005-01-14 20:03 UTC] elliot at onehouse dot net

Yep, the change to the cache checking portion of the send method did the trick. Thanks! :)

[2005-01-14 20:10 UTC] elliot at onehouse dot net

Sorry, forgot to close the bug with my last comment.