• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 154
  • Last Modified:

links to open in new window -not download. Dreamweaver OS X

I want to designate word docs and pdfs to open in a new window from the link on my site.  Currently the Word docs automatically download - so I want to view them first... how can I do that?
2 Solutions
Without using a server-side language (ASP, PHP etc) to control the page headers, you are at the mercy of the browser's default behaviour.  Therefore you need to edit the file type data within Windows to control how Windows deals with the file once it's been downloaded to the Temporary Internet Files folder.

If you have a server side language, you can manually add a header to the page before it's sent, that tries to get the browser to display it.  The code (in ASP) is:

Response.AddHeader "Content-Disposition", "inline; filename=myfile.doc;"

Note that there is NO 100% way of making this work in all browsers/platforms.
Jason C. LevineNo oneCommented:
>> Note that there is NO 100% way of making this work in all browsers/platforms.

Bears repeating.  Any user of any browser can force docs and pdfs to download no matter how much effort you exter to the contrary.  

Ironically, if you wanted to force the documents to download instead of opening in the browser it's far easier to accomplish.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now