views:

381

answers:

2

Hi,

I have just moved a web application to a windows server and having some problems. One of it is - application stores list of names of files in a database table. when a files is requested for download it is sent to output by sending proper headers (depending upon mime type and then a readfile("document location/filename.extension");

it works fine in firefox but if I try to download in IE it throws

IE can not dowload this document from www.mysite.com .. IE was unable to open this Internet site. The requested file is either unavailable or cannot be found. Please try again later.

As it was working fine on previous server (non-windows), I tried to print document location and it read somewhat like C:/Apache/htdocs/FILENAME.ext and I guess this C:/ is causing problem in IE but not in firefox??

How do I get it working right in IE??

Thanks

UPDATE

I have got it working by adding some more headers among others .. I think first 2 are more important for IE or so (atleast working for me for now :)

header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
A: 

this question had already been answered here http://stackoverflow.com/questions/1597732/php-force-file-download-and-ie-yet-again

Tim
A: 

Is this by any chance over SSL? If so, there are a whole host of bugs in MSIE which could be affecting your app. Try setting a very short caching time.

If it works on Firefox using the the same server, then the problem unlikely to be anything to do with the path on the server. Although beware that (IME) IIS seems to tunnel authorization from MSIE clients (but not others) in some instances.

symcbean
Yes, its over SSL .. how do I set short caching time? how does it help? many thanks.
header('Cache-control: max-age=3');Not sure exactly how it works - as I said, there's several bugs in MSIE around this.C.
symcbean