I was having strange intermittent trouble with IE and pdfs with a filefield alias. Most of them seem to work fine but a few produced an error but only in IE. I found that a 'Cache-Control: public' is needed for IE. I changed the last few lines of file_aliases.module to:

  header('Content-Type: '. $result->filemime);
  header('Cache-Control: public'); // needed for IE.
  readfile($result->filepath);

Comments

tanc’s picture

deciphered’s picture

Status: Needs review » Active

Hi tanc,

When you say that some produced the error, was it a per file basis? Would one particular file always produce an error?
If so, is it possible to provide a pdf that produces the error so I can confirm the issue?

I will keep testing with random pdf's in the meantime and will update the issue if I do manage to confirm it.

Cheers,
Deciphered.

deciphered’s picture

Project: File (Field) Paths » File Aliases

Issue moved to File Aliases.

tanc’s picture

Hi deciphered, this error was only occurring with IE and only on certain files. The error IE produced was "Navigation Cancelled" which doesn't tell me much. One file that was producing this error (but is now fixed due to my cache-control code) was: http://www.reisuper.com.au/publications/insurance%20through%20super.pdf

Not much else I can think of that would be useful, other than this definitely fixed my issue.

deciphered’s picture

Status: Active » Fixed

Fixed and committed to HEAD and DRUPAL-5.

 

@tanc

I didn't actually manage to reproduce the issue, and generally I don't like commit a fix for an issue without determining that the fix is the best best fix, however I can't see that anything is wrong with the code and did come across similar issues a few years ago with another module I was using that was fixed in much the same way.

Let me know if you have any issues.

Cheers,
Deciphered.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.