With IE 6, when users click on an attached PDF file, they get an option to Open or Save the document. If they attempt to open, Acrobat Reader starts up but then chokes stating: "There was an error opening this document. This file cannot be found." It appears the file downloads (subjective guess, based on the amount of time it takes before the error comes up).
this seems to be the same as an issue with the upload module see http://drupal.org/node/30525 and http://drupal.org/node/61528 for more details.
In the filemanager module at approx line 580 is the following code
$default_headers = array(
'Content-Type: '. $file->mimetype,
'Content-Length: '. $file->size,
'Content-Disposition: attachment; filename="'. $file->filename .'"'
);
If I remove the Content-Disposition line the pdf now opens inline in the browser window in both IE6 and firefox 1.5 I dont have any other browsers to test nearby.
This is what I actually want to happen and I'm happy to remove it from the code but it doesnt really answer the question as to why IE6 actually fails to correctly download and then pass on to acrobat the pdf file
firefox used to open the file inline but with the content-disposition header it actually asks you what you want to do with the file, which is presumably the correct behaviour
Comments
Comment #1
davea commentedEnsure that you are NOT using the upload.module in core as it can lead to confusion on determining the problem.
Some of this is posted at
http://drupal.org/project/comments/add/30525
as well.
Here are the headers that I found that appear to solve this problem:
And here are some links:
http://support.microsoft.com/default.aspx?scid=kb;en-us;316431
http://bugs.php.net/bug.php?id=16173
http://pkp.sfu.ca/support/forum/viewtopic.php?p=359&sid=4516e6d325c613c7...
http://forum.springframework.org/showthread.php?t=24466
I tested this on the following environments:
IE6/W2k/Office2k3
IE6/XP/no-office
Firefox/Linux
Firefox/XP/no-office
Have a great day!
Comment #2
fluxrider commentedVery very excited to find this page in the labyrinth after two days hunting and an unanswered post in the forums and thanks , files are now opening in safari and firefox browsers and I'll test ie6 at work tomorrow, and I've learnt a bit more. I'm probably going to get jumped on for posting in the wrong spot ::sigh:: but the only issue I have left is how to get that pdf file to open in another window. If someone could pretty please tell me how just before they tell me off for posting here , well , I will be both grateful and suitably chastised.
Comment #3
fluxrider commentedsorry. would delete previous post but cant . Please delete both these posts if you can
::hangs head in shame::
Comment #4
drewish commentedfluxrider, you can't really delete posts so don't worry about it. what changes did you make to your module and what worked for you?
Comment #5
fluxrider commentedHi drewish
Thanks. I haven't actually solved the pdf opening in a new link yet. I'm presently mucking about with the filemanager module , but haven't had success yet . The pdf's are displaying okay in all browsers I've checked , but its unfortunate that they open over the site . I dont want all links to act this way , or even external links because the user can set their own prefs in their own browsers , but I think the pdf file needs to open up in a new window. If I figure it out I'll post .....unless you have a solution :)
Thanks drewish anyhow.
kate
Comment #6
WorldFallz commentedAre you trying for a new separate PDF reader window or just a new browser window? If a new browser window would do, couldn't you simply append TARGET = "_blank" where the URL for the file is created? However, this would affect all files. If you want to limit that behaviour to pdf, you'd have to parse the filename for the PDF extension and only do it in that case.
Comment #7
ramonhimera commentedheader("Cache-Control: private");
worked for me after a LOT of searching
Comment #8
pomliane commentedThis version of Filemanager is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.
This issue has been automagically closed by a script.