Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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

share|improve this question
    
Bill, does it do this on other computers as well? –  Micky McQuade Jul 21 '10 at 16:50
    
Yes, it does; I have tested it on 3 separate machines. –  Bill Cabral Jul 21 '10 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. –  Bill Cabral Jul 21 '10 at 18:07
add comment

2 Answers

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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