0

Working on a page that contains links to files such as doc, excel, PDF.

On IE 8 if a user clicks the link(an example would be www.examplesite.com/files/somefile.doc), the page starts to load the URL from the link and a save dialogue opens up. This behavior doesn't exist in IE 9 and Firefox. The browsers Simply open a save dialogue box without navigating away from the initial page.

I don't want the browser to load the download link and navigate away from the initial page. the user accessed. One solution I found is to add a target='blank' attribute on the link. But this would open a new window which is fine but not the best solution I wanted to have.

Is there any way to mimic the same behavior in IE 8 to enable the user to open the dialogue without navigating away from the current page.

Http header response captured in firefox looks like this.

HTTP/1.1 200 OK
Content-Type: application/msword
Last-Modified: Thu, 21 Feb 2013 17:29:08 GMT
Accept-Ranges: bytes
Content-Length: 556544
user624558
  • 559
  • 2
  • 8
  • 20
  • if you have control of the server you might look into `Content-Disposition: attachment..`. See here: http://stackoverflow.com/questions/8875949/how-to-implement-content-disposition-attachment – Madbreaks Feb 27 '13 at 00:26
  • @Madbreaks I have access to the servers. The content is placed on FTP server that is acting as a download server. what we do is build the URL to the content and put the link on the page. Any information on how to set the `Content-Disposition` on the server? – user624558 Feb 27 '13 at 00:39

0 Answers0