Posted by tanc on March 24, 2009 at 9:14am
Jump to:
| Project: | File Aliases |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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
#1
Reference: http://au.php.net/manual/en/function.readfile.php#85789
#2
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.
#3
Issue moved to File Aliases.
#4
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.
#5
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.
#6
Automatically closed -- issue fixed for 2 weeks with no activity.