Web :: Browser issues :: PDF opening problem with Internet Explorer : "can not download file" |
|||
| By: Bernard |
Date: 28/07/2005 13:14:24 |
Points: 20 | Status: Answered Quality : Good |
|
Hello, I built an intranet site where you can click on PDF links. They open using whatever plugin there is in the browser for Acrobat Reader. This works like a charm in standard browsers like Mozilla Firefox (not a single javascript warning on that page), but I 've just been reported from some Internet Explorer guy that he received an error message ... I checked and indeed, IE displays "Internet Explorer could not download ...(blah blah blah). The downloaded file is not available." This is bullshit IMHO. The files are perfectly available. Is the plugin broken ? Or the browser ? Or something else ? Thanks for help, I lost hours searching for this Internet Explorer-specific "feature". Thanks God, normal users use normal browsers and don't get that silly "error" ;-) But I would like to fix it anyway. Any idea ? |
|||
| By: VGR | Date: 28/07/2005 13:46:12 | Type : Answer |
|
| cool stuff ;-) Microsoft Internet Exploiter BUG in short, the solution is to provide an "Expires:" HTTP header in the future, like this in PHP : $tomorrow=date('r',strtotime('+1 days')); Header("Expires: $tomorrow"); // rest of your PDF content_type/size/disposition attach/inline headers here I don't know if this works, though ;-)) |
|||
| By: Bernard | Date: 28/07/2005 17:29:40 | Type : Comment |
|
| Hummm it's the same error message, but I clearly didn't pass any "Expires: in the past" value... How bizarre... Anyway, I managed to get rid of the error ! I modified this kind of code (works well in FF) : <img src="pdf.gif" border="0" style="cursor:crosshair;" OnClick="window.open('$PHP_SELF?openpdf=$fileref','_pdf','width=400, height=800, resizable=yes, scrollbars=yes, toolbar=no, location=no, status=yes, menubar=no, directories=no');" alt="pdf" title="open invoice PDF $fileref"> into (works in both, of course, it's the same result) : <a border="0" style="cursor:crosshair;" href="$PHP_SELF?openpdf=$fileref" target="_blank"><img src="pdf.gif" border="0" alt="pdf" title="open invoice PDF $fileref"></a> "Comprenne qui peut" ;-) |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








