visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Web :: Browser issues :: PDF opening problem with Internet Explorer : "can not download file"


By: Bernard France  Date: 28/07/2005 13:14:24  English French  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 English  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 English French  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

EContact
browser fav
page generated in 337.638850 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page