tags:

views:

158

answers:

2

I have a link using tag and it is linked to a .doc file in the server. When I click on the link, instead of giving the open, save box, it opens the file in the browser in the binary format. Has anyone encountered this problem? I am using a Weblogic server.

A: 

try setting the MIME Type, possibly to application/msword or application/doc

EDIT: If the server doesn't know the mime type of the file then it defaults to text/plain and displays the bytes.

Russ Bradberry
+1  A: 

As Russ said, sometimes you have to add the Content-Type header to explicitly set the mime type; and sometimes, you also have to add a Content-Disposition header, perhaps to a value like

"attachment; filename=doc1.doc"

If Russ' fix doesn't work for you, try adding this additional header.

Vinay Sajip