5

I'm working on a flex app that relates documents (pdfs, images, etc) with events. When i click the document link in my app for PDFs, images, text files, etc, IE7 and IE8 present them in the appropriate editor and life is good. However, if the linked document is a .doc file, the popup window that shows when you click the link simply closes without displaying the file or prompting me to save it to a particular location. Clicking the same document link in Firefox 3.5 prompts me to Open/Save the document, and opens it properly in Word. I have not run across any other file type/browser combination that exhibits this same behavior...just doc/IE. Does IE have some security restrictions related to opening doc files? Does anyone have any idea why this might be happening or how I could go about fixing it? Thanks,

-Bill

3
  • Bill, does it do this on other computers as well? Jul 21, 2010 at 16:50
  • Yes, it does; I have tested it on 3 separate machines. Jul 21, 2010 at 16:51
  • As an update, if you hold ctrl and click, it prompts you to save/open the file. Why this is required for docs and no other file types is beyond me. Jul 21, 2010 at 18:07

2 Answers 2

2

Your webserver might not be sending the appropriate headers. If memory serves you need to send:

Content-Type: application/msword
Content-Length: <file size in bytes>
Content-Disposition: attachment; filename="<file name>"
Content-Transfer-Encoding: binary
Cache-Control: must-revalidate, post-check=0, pre-check=0

If this doesn't do the trick try adding a Pragma and Expires header.

0

IE has had trouble with this sort of thing in the past. I feel like ever year or so I need to change around some of the headers associated with documents a browser cannot generally embed. Cache stuff usually. You are not using https for these transactions perchance? Is it the same .doc file or is it across multiple different .docs? Are you sending the filename in a "Content-Disposition" header? Strange characters in there could gum up the works.

These bugs are my personal Groundhog Day: usually fiddling with the headers are the way to go.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.